jupyter / jupyter_client

Jupyter protocol client APIs
https://jupyter-client.readthedocs.io
BSD 3-Clause "New" or "Revised" License
381 stars 280 forks source link

Jupyter notebook kernel error #551

Open vjuliosouza opened 4 years ago

vjuliosouza commented 4 years ago

I have just download Anaconda and while trying to create a new Python file in Jupyter notebook the following error message appeared:

Traceback (most recent call last): File "C:\Anaconda\lib\site-packages\traitlets\traitlets.py", line 528, in get value = obj._trait_values[self.name] KeyError: 'kernel_manager_factory' ​ During handling of the above exception, another exception occurred: ​ Traceback (most recent call last): File "C:\Anaconda\lib\site-packages\tornado\web.py", line 1699, in _execute File "C:\Anaconda\lib\site-packages\tornado\gen.py", line 742, in run yielded = self.gen.throw(exc_info) # type: ignore File "C:\Anaconda\lib\site-packages\notebook\services\sessions\handlers.py", line 72, in post type=mtype)) File "C:\Anaconda\lib\site-packages\tornado\gen.py", line 735, in run value = future.result() File "C:\Anaconda\lib\site-packages\tornado\gen.py", line 742, in run yielded = self.gen.throw(exc_info) # type: ignore File "C:\Anaconda\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 88, in create_session kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name) File "C:\Anaconda\lib\site-packages\tornado\gen.py", line 735, in run value = future.result() File "C:\Anaconda\lib\site-packages\tornado\gen.py", line 742, in run yielded = self.gen.throw(*exc_info) # type: ignore File "C:\Anaconda\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 101, in start_kernel_for_session self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name) File "C:\Anaconda\lib\site-packages\tornado\gen.py", line 735, in run value = future.result() File "C:\Anaconda\lib\site-packages\tornado\gen.py", line 209, in wrapper yielded = next(result) File "C:\Anaconda\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel super(MappingKernelManager, self).start_kernel(**kwargs) File "C:\Anaconda\lib\site-packages\jupyter_client\multikernelmanager.py", line 105, in start_kernel return port File "C:\Anaconda\lib\site-packages\traitlets\traitlets.py", line 556, in get return self.get(obj, cls) File "C:\Anaconda\lib\site-packages\traitlets\traitlets.py", line 535, in get value = self._validate(obj, dynamic_default()) File "C:\Anaconda\lib\site-packages\jupyter_client\multikernelmanager.py", line 62, in _kernel_manager_factory_default

Cache all the currently used ports

File "C:\Anaconda\lib\site-packages\ipython_genutils\importstring.py", line 31, in import_item module = import(package, fromlist=[obj]) File "C:\Anaconda\lib\site-packages\jupyter_client\ioloop__init__.py", line 1, in from .manager import IOLoopKernelManager, AsyncIOLoopKernelManager File "C:\Anaconda\lib\site-packages\jupyter_client\ioloop\manager.py", line 14, in from jupyter_client.manager import KernelManager, AsyncKernelManager ImportError: cannot import name 'AsyncKernelManager' from 'jupyter_client.manager' (C:\Anaconda\lib\site-packages\jupyter_client\manager.py) ​

I am an aboslute begginer and I haven't even learned how to code yet, so I don't understand much about codding language. I haven't installed Anaconda in the usual folder because due to my user name I was having trouble running it.

kevin-bates commented 4 years ago

This appears to be some form of packaging issue with jupyter_client where C:\Anaconda\lib\site-packages\jupyter_client\manager.py is actually from an older release than the rest of the files.

I'm going to transfer this issue to the jupyter_client repo.

MSeal commented 4 years ago

Uhg, I have not dug into the conda-forge builds for this repo yet. I'm not a maintainer on the conda forge recipe to help outside of a PR. @SylvainCorlay @minrk Could one of you either help with tracking this down or add/or myself and kevin as maintainers to the conda forge repo in case we need to help with items like this in the future?

MSeal commented 4 years ago

In the meanwhile, @vjuliosouza did you have an existing conda environment or make a brand new one when you tried installing packages? It might help to have you outline the steps you took in setup to see where it might have gone wrong. Typically making a new environment and installing your dependencies into there will resolve these types of issues as something the existing one got damaged or mis-installed somehow.

Also try conda install 'jupyter_client=6.1.3' to see if it picks up the correct files

vjuliosouza commented 4 years ago

I have tried installing it before, but the same thing happened. I am probably going to format my PC in order to get rid of any files from the previous installation. I the problem persists I give you guys a touch. Thanks for the help

jtlz2 commented 4 years ago

@MSeal @kevin-bates @vjuliosouza Any update on this at all? I am trying to get a jupyterlab kernel running in jupyterhub on k8s. Let me know if you need any more info - this is a showstopper for me right now... Thanks!

jtlz2 commented 4 years ago

My SO question refers

https://stackoverflow.com/questions/63754426/jupyterhub-jupyterlab-importerror-cannot-import-name-asynckernelmanager-fro

MSeal commented 4 years ago

@bollwyvl and @SylvainCorlay are the most active contributors with permissions to the conda recipe repo (if one of you could add the other maintainers to that repo please do so). However it looks like that recipe has been updated recently. Have you debugged what versions you are getting in your conda environment? It's likely you are either using a different conda environment than you think you are or you have older versions of libraries installed as a result of a different library installation.