2

Jupyter notebooks fail to launch every time I try to create a new one. It says that ipykernel is not installed, and if I click install it says it is already installed for this virtual environment (created with anaconda3) and then it just gives me an error message that I will paste in below. Any ideas as to what is causing this or how to fix it? thanks in advance!

Jupyter notebook failed to launch. 
Error: Traceback (most recent call last):
  File "c:\Users\davis\.vscode\extensions\ms-python.python-2020.6.91350\pythonFiles\vscode_datascience_helpers\daemon\daemon_python.py", line 54, in _decorator
    return func(self, *args, **kwargs)
  File "c:\Users\davis\.vscode\extensions\ms-python.python-2020.6.91350\pythonFiles\vscode_datascience_helpers\jupyter_daemon.py", line 105, in m_exec_module_observable
    self._start_notebook(args, cwd, env)
  File "c:\Users\davis\.vscode\extensions\ms-python.python-2020.6.91350\pythonFiles\vscode_datascience_helpers\jupyter_daemon.py", line 147, in _start_notebook
    from notebook import notebookapp as app
  File "C:\Users\davis\AppData\Roaming\Python\Python38\site-packages\notebook\notebookapp.py", line 49, in <module>
    from zmq.eventloop import ioloop
  File "C:\Users\davis\AppData\Roaming\Python\Python38\site-packages\zmq\__init__.py", line 47, in <module>
    from zmq import backend
  File "C:\Users\davis\AppData\Roaming\Python\Python38\site-packages\zmq\backend\__init__.py", line 40, in <module>
    reraise(*exc_info)
  File "C:\Users\davis\AppData\Roaming\Python\Python38\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
    raise value
  File "C:\Users\davis\AppData\Roaming\Python\Python38\site-packages\zmq\backend\__init__.py", line 27, in <module>
    _ns = select_backend(first)
  File "C:\Users\davis\AppData\Roaming\Python\Python38\site-packages\zmq\backend\select.py", line 28, in select_backend
    mod = __import__(name, fromlist=public_api)
  File "C:\Users\davis\AppData\Roaming\Python\Python38\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
    from . import (constants, error, message, context,
ImportError: cannot import name 'constants' from partially initialized module 'zmq.backend.cython' (most likely due to a circular import) (C:\Users\davis\AppData\Roaming\Python\Python38\site-packages\zmq\backend\cython\__init__.py)

Failed to run jupyter as observable with args notebook --no-browser --notebook-dir=C:\Users\davis\AppData\Local\Temp\cda4e2c0-a341-4667-b662-1bd918e5238e --config=C:\Users\davis\AppData\Local\Temp\cda4e2c0-a341-4667-b662-1bd918e5238e\jupyter_notebook_config.py --NotebookApp.iopub_data_rate_limit=10000000000.0
dvas89
  • 25
  • 1
  • 3

1 Answers1

1

When you try to install the package, VSCode said you had installed it in the virtual environment. This means you are using the virtual environment. But the Traceback shows you are using the package under the Romaing folder instead of the virtual environment under your project. You should choose either to use the virtual environment or to use the global environment and fix the package problem.

If you choose the global environment, try to reinstall or upgrade 'zmq' package:

reinstall: "pip uninstall pyzmq" -> "pip install pyzmq".

upgrade: "pip install --upgrade pyzmq" or "pip install --upgrade pyzmq jupyterlab jupyter --force-reinstall".

You can refer to zmq: Can not launch jupyter notebook for more information.

Steven-MSFT
  • 7,438
  • 1
  • 5
  • 13