我通过以下方式安装了 jupyter:/usr/local/opt/python/bin/python2.7 -m pip install jupyter
这将安装 ipython 版本 4.1.2。但是,当我运行 jupyter Notebook 时,我得到:
Traceback (most recent call last):
File "/usr/local/bin/jupyter-notebook", line 7, in <module>
from notebook.notebookapp import main
File "/Library/Python/2.7/site-packages/notebook/notebookapp.py", line 83, in <module>
from IPython.paths import get_ipython_dir
ImportError: No module named IPython.paths
然而,当我直接在 ipython shell 中运行 from IPython.paths import get_ipython_dir 时,它工作正常。另外,当我运行 /usr/local/opt/python/bin/python2.7 然后同样的事情时,它运行成功。另外,当我检查 python 中的 sys.executable 路径时,我得到/usr/local/opt/python/bin/python2.7
这对我来说没有意义。 Ipython 和我的普通 python (都使用 /usr/local/opt/python/bin/python2.7 )如何都能成功运行这个命令,但是我的 jupyter 安装了该特定的 python,无法运行该命令。有什么建议么?
我有同样的问题。刚才这对我有帮助。有人可能会发现这很有用。
from IPython.paths import get_ipython_dir
ImportError: No module named IPython.paths
所以我在 Linux mint 17 上运行 Python 3。我首先使用命令从系统中卸载了 jupyter。
sudo -H pip3 uninstall jupyter
成功卸载后,我使用以下命令再次安装了 jupyter。
sudo -H pip3 install jupyter
当我再次使用启动 jupyter 时
jupyter notebook
The kernel
没有死亡或没有重新启动。现在一切正常。我希望至少有一个人觉得这很有用。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)