kernel_gateway_demos icon indicating copy to clipboard operation
kernel_gateway_demos copied to clipboard

ImportError: cannot import name 'ensure_dir_exists'

Open stenpiren opened this issue 6 years ago • 4 comments

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?

stenpiren avatar Jul 05 '18 13:07 stenpiren

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

kevin-bates avatar Jul 05 '18 14:07 kevin-bates

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 avatar Jul 06 '18 06:07 stenpiren

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

stenpiren avatar Jul 06 '18 06:07 stenpiren

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.

kevin-bates avatar Jul 06 '18 15:07 kevin-bates