2017-05-26 110 views
3

我最近通過condo update ipython從IPython 5.x升級到6.0。不過,我得到內核崩潰:從IPython 5.x升級到6.0導致IPython.utils.warn崩潰導致崩潰

Traceback (most recent call last): 
    File "//anaconda/lib/python3.5/runpy.py", line 170, in _run_module_as_main 
    "__main__", mod_spec) 
    File "//anaconda/lib/python3.5/runpy.py", line 85, in _run_code 
    exec(code, run_globals) 
    File "//anaconda/lib/python3.5/site-packages/ipykernel/__main__.py", line 2, in <module> 
    from ipykernel import kernelapp as app 
    File "//anaconda/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 37, in <module> 
    from .ipkernel import IPythonKernel 
    File "//anaconda/lib/python3.5/site-packages/ipykernel/ipkernel.py", line 15, in <module> 
    from .zmqshell import ZMQInteractiveShell 
    File "//anaconda/lib/python3.5/site-packages/ipykernel/zmqshell.py", line 46, in <module> 
    from IPython.utils.warn import error 
ImportError: No module named 'IPython.utils.warn' 
[I 18:35:28.928 NotebookApp] KernelRestarter: restarting kernel (1/5) 

顯然,問題是,IPython.utils.warn被棄用,has now been removed爲6.0.0版本。我怎樣才能解決這個問題?

注:無下面的工作:

pip install --upgrade ipython 
pip install --upgrade jupyter 
pip install --upgrade --no-deps --force-reinstall ipython 
pip install --upgrade --no-deps --force-reinstall jupyter 

回答

4

我有同樣的問題。以下行解決了我的問題:

conda update ipykernel 

我不知道爲什麼這不是自動完成的。

0

+1同樣的問題。

解決方法是降級到IPython中的最新的可用5.x版(目前通過conda search ipython發現5.3.0):

conda install ipython=5.3.0 

現在Jupyter筆記本內核可以重新開始。