繁体   English   中英

ImportError:运行jupyter notebook时没有名为IPython.paths的模块?

[英]ImportError: No module named IPython.paths when running jupyter notebook?

我通过以下方式安装了jupyter: /usr/local/opt/python/bin/python2.7 -m pip install jupyter

这个安装ipython版本4.1.2。 但是,当我运行jupyter笔记本时,我得到:

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.paths运行时直接在ipython shell中导入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

所以我在Linux17上运行Python 3.我首先使用该命令从我的系统中卸载了jupyter。

sudo -H pip3 uninstall jupyter

成功卸载后,我使用以下命令再次安装了jupyter。

sudo -H pip3 install jupyter

当我再次使用jupyter时

jupyter notebook

kernel没有死或没有重启。 现在一切都很好。 我希望至少有一个人觉得这很有用。

升级ipython:

pip install ipython==5.3.0

如果你无法卸载ipython,试试这个:

sudo -H pip install --ignore-installed -U ipython==5.3.0

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM