Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: cannot import name 'ensure_dir_exists'

I update the Jupyter notebook from the old version to latest 5.3.1. However, when I try to launch the notebook from anaconda, it throws an import error: I tried to remove and install Jupyter package, still, the issue persists.

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'
like image 844
Santosh Kangane Avatar asked Jan 21 '18 21:01

Santosh Kangane


3 Answers

You need to update jupyter_core and jupyter_client manually from your terminal:

conda update jupyter_core jupyter_client
like image 199
piratefache Avatar answered Oct 23 '22 03:10

piratefache


If you've installed jupyter using pip3.

pip3 install --upgrade jupyter_core jupyter_client
like image 21
pavan Avatar answered Oct 23 '22 03:10

pavan


update jupyter core

pip install jupyter-core --upgrade

this working for me in Anaconda3 with python 3.6

like image 8
Cristian Q Avatar answered Oct 23 '22 04:10

Cristian Q