Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'ensure_dir_exists' #61

Open
stenpiren opened this issue Jul 5, 2018 · 4 comments
Open

ImportError: cannot import name 'ensure_dir_exists' #61

stenpiren opened this issue Jul 5, 2018 · 4 comments

Comments

@stenpiren
Copy link

stenpiren commented Jul 5, 2018

After cloning the entire repository and doing docker-compose build and then docker-compose up I get I get the following Traceback:

Starting scotch_demo_julia_api_1 ... done
Starting scotch_demo_python_api_1 ... done
Starting scotch_demo_r_api_1 ... done
Starting scotch_demo_notebook_1 ... done
Attaching to scotch_demo_julia_api_1, scotch_demo_python_api_1, scotch_demo_notebook_1, scotch_demo_r_api_1
julia_api_1 | Traceback (most recent call last):
julia_api_1 | File "/opt/conda/bin/jupyter-kernelgateway", line 7, in
julia_api_1 | from kernel_gateway import launch_instance
julia_api_1 | File "/opt/conda/lib/python3.5/site-packages/kernel_gateway/init.py", line 4, in
julia_api_1 | from .gatewayapp import launch_instance
julia_api_1 | File "/opt/conda/lib/python3.5/site-packages/kernel_gateway/gatewayapp.py", line 13, in
julia_api_1 | from notebook.services.kernels.kernelmanager import MappingKernelManager
julia_api_1 | File "/opt/conda/lib/python3.5/site-packages/notebook/init.py", line 25, in
julia_api_1 | from .nbextensions import install_nbextension
julia_api_1 | File "/opt/conda/lib/python3.5/site-packages/notebook/nbextensions.py", line 27, in
julia_api_1 | from jupyter_core.utils import ensure_dir_exists
julia_api_1 | ImportError: cannot import name 'ensure_dir_exists'
notebook_1 | Traceback (most recent call last):
notebook_1 | File "/opt/conda/bin/jupyter-notebook", line 7, in
notebook_1 | from notebook.notebookapp import main
notebook_1 | File "/opt/conda/lib/python3.5/site-packages/notebook/init.py", line 25, in
notebook_1 | from .nbextensions import install_nbextension
notebook_1 | File "/opt/conda/lib/python3.5/site-packages/notebook/nbextensions.py", line 27, in
notebook_1 | from jupyter_core.utils import ensure_dir_exists
notebook_1 | ImportError: cannot import name 'ensure_dir_exists'
python_api_1 | Traceback (most recent call last):
python_api_1 | File "/opt/conda/bin/jupyter-kernelgateway", line 7, in
python_api_1 | from kernel_gateway import launch_instance
python_api_1 | File "/opt/conda/lib/python3.5/site-packages/kernel_gateway/init.py", line 4, in
python_api_1 | from .gatewayapp import launch_instance
python_api_1 | File "/opt/conda/lib/python3.5/site-packages/kernel_gateway/gatewayapp.py", line 13, in
python_api_1 | from notebook.services.kernels.kernelmanager import MappingKernelManager
python_api_1 | File "/opt/conda/lib/python3.5/site-packages/notebook/init.py", line 25, in
python_api_1 | from .nbextensions import install_nbextension
python_api_1 | File "/opt/conda/lib/python3.5/site-packages/notebook/nbextensions.py", line 27, in
python_api_1 | from jupyter_core.utils import ensure_dir_exists
python_api_1 | ImportError: cannot import name 'ensure_dir_exists'
r_api_1 | Traceback (most recent call last):
r_api_1 | File "/opt/conda/bin/jupyter-kernelgateway", line 7, in
r_api_1 | from kernel_gateway import launch_instance
r_api_1 | File "/opt/conda/lib/python3.5/site-packages/kernel_gateway/init.py", line 4, in
r_api_1 | from .gatewayapp import launch_instance
r_api_1 | File "/opt/conda/lib/python3.5/site-packages/kernel_gateway/gatewayapp.py", line 13, in
r_api_1 | from notebook.services.kernels.kernelmanager import MappingKernelManager
r_api_1 | File "/opt/conda/lib/python3.5/site-packages/notebook/init.py", line 25, in
r_api_1 | from .nbextensions import install_nbextension
r_api_1 | File "/opt/conda/lib/python3.5/site-packages/notebook/nbextensions.py", line 27, in
r_api_1 | from jupyter_core.utils import ensure_dir_exists
r_api_1 | ImportError: cannot import name 'ensure_dir_exists'
scotch_demo_julia_api_1 exited with code 1
scotch_demo_notebook_1 exited with code 1
scotch_demo_r_api_1 exited with code 1
scotch_demo_python_api_1 exited with code 1

Thus I am unable to start any of the APIs. Any clue how to solve this?

@kevin-bates
Copy link
Member

This implies an update of jupyter_core is necessary.

Looks like Kernel Gateway's dependency on is jupyter_core>=4.0.0, when it should probably get updated to jupyter_core>=4.4.0

@stenpiren
Copy link
Author

Hi @kevin-bates is the update to be done inside the docker image? I googled before opening the issue as "conda update jupyter_core jupyter_client" did not help solve the issue. Any other clues?

@stenpiren
Copy link
Author

This is my updated jupyter and dependencies. Still it outputs same error.
screen shot 2018-07-06 at 08 36 03

@kevin-bates
Copy link
Member

kevin-bates commented Jul 6, 2018

Hi @stenpiren - thanks for the update. I'm unfamiliar with the scotch_demo but, yes, the docker image is where the update is required. Looking at the Dockerfile, I believe the issue is probably due to the demo code pinning the source docker image to a specific tag: FROM jupyter/datascience-notebook:8015c88c4b11 which contains an older version of jupyter_core.

If you drop the tag portion of the FROM clause (e.g., FROM jupyter/datascience-notebook) then the latest datascience-notebook image will be used - which should have updated components. I'm not aware of anything that would preclude JKG from working with the latest image.

Please try that next - thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants