Issue
I am using Python 3.9.9 via pyenv
on a Mac with an Intel chip. I installed Jupyter using pip install juypter
. When I run which jupyter
I get the response /Users/<username>/.pyenv/shims/jupyter
, so Jupyter has installed. However, when I run jupyter notebook
I get the following error:
Traceback (most recent call last):
File "/Users/<username>/.pyenv/versions/3.9.9/bin/jupyter-notebook", line 8, in <module>
sys.exit(main())
File "/Users/<username>/.pyenv/versions/3.9.9/lib/python3.9/site-packages/jupyter_core/application.py", line 264, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/Users/<username>/.pyenv/versions/3.9.9/lib/python3.9/site-packages/traitlets/config/application.py", line 845, in launch_instance
app.initialize(argv)
File "/Users/<username>/.pyenv/versions/3.9.9/lib/python3.9/site-packages/traitlets/config/application.py", line 88, in inner
return method(app, *args, **kwargs)
File "/Users/<username>/.pyenv/versions/3.9.9/lib/python3.9/site-packages/notebook/notebookapp.py", line 2141, in initialize
self._init_asyncio_patch()
File "/Users/<username>/.pyenv/versions/3.9.9/lib/python3.9/site-packages/notebook/notebookapp.py", line 2117, in _init_asyncio_patch
nest_asyncio.apply()
File "/Users/<username>/.pyenv/versions/3.9.9/lib/python3.9/site-packages/nest_asyncio.py", line 14, in apply
raise ValueError('Can\'t patch loop of type %s' % type(loop))
ValueError: Can't patch loop of type <class 'NoneType'>
I have never seen this error before and my search for a solution has been fruitless. Any ideas?
Solution
Apparently this error occurs for nest-asyncio=1.5.2
(issue). Upgrading to nest-asyncio=1.5.3
worked for me. You can run the following commands to uninstall the existing version and upgrade to 1.5.3
:
pip uninstall nest-asyncio
pip install nest-asyncio==1.5.3
Answered By - MD Billal Hossain
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.