jupyter notebook重装或更新后,执行jupyter notebook出现如下错误:
Traceback (most recent call last):
File "/home/cc/install/anaconda3/bin/jupyter-notebook", line 7, in <module>
from notebook.notebookapp import main
File "/home/cc/install/anaconda3/lib/python3.6/site-packages/notebook/__init__.py", line 25, in <module>
from .nbextensions import install_nbextension
File "/home/cc/install/anaconda3/lib/python3.6/site-packages/notebook/nbextensions.py", line 27, in <module>
from jupyter_core.utils import ensure_dir_exists
ImportError: cannot import name 'ensure_dir_exists'
解决办法:升级jupyter_core和jupyter_client
conda update jupyter_core jupyter_client
其他解决办法:https://stackoverflow.com/questions/48372019/importerror-cannot-import-name-ensure-dir-exists
执行上述更新和可能的一些其他操作后,我发现虽然没有报错了,但调用的python环境为系统自带的python,并不是我需要的anaconda中的python,此时的解决办法参考: