簡體   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