ImportError:无法导入名称'ensure_dir_exists'

San*_*ane 25 python jupyter-notebook

我将Jupyter笔记本从旧版本更新到最新的5.3.1.但是,当我尝试从anaconda启动笔记本时,它会抛出一个导入错误:我试图删除并安装Jupyter包,但问题仍然存在.

Traceback (most recent call last):
File "C:\Users\v-kangsa\AppData\Local\Continuum\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in 
from notebook.notebookapp import main
File "C:\Users\v-kangsa\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\__init__.py", line 25, in 
from .nbextensions import install_nbextension
File "C:\Users\v-kangsa\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\nbextensions.py", line 27, in 
from jupyter_core.utils import ensure_dir_exists
ImportError: cannot import name 'ensure_dir_exists'
Run Code Online (Sandbox Code Playgroud)

小智 54

您需要从终端手动更新jupyter_core和jupyter_client:

conda update jupyter_core jupyter_client
Run Code Online (Sandbox Code Playgroud)


pav*_*van 19

如果你已经安装了jupyter pip3.

pip3 install --upgrade jupyter_core jupyter_client
Run Code Online (Sandbox Code Playgroud)


小智 7

更新jupyter核心

pip install jupyter-core --upgrade
Run Code Online (Sandbox Code Playgroud)

这在蟒蛇蟒蛇Anaconda3中为我工作