jupyter / notebook

Jupyter Interactive Notebook
https://jupyter-notebook.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
11.77k stars 5k forks source link

ModuleNotFoundError: No module named 'zmq.asyncio' #6329

Open dip16gphy opened 2 years ago

dip16gphy commented 2 years ago

I am trying to open jupyter notebook in obspy environment, but it keeps throwing the same error again and again even after updating all the packages & reinstalling the notebook. I have pyzmq 22.3.0.

Here is the error:

Traceback (most recent call last): File "C:\Users\UPLC\anaconda3\envs\obspy\Scripts\jupyter-notebook-script.py", line 5, in from notebook.notebookapp import main File "C:\Users\UPLC\anaconda3\envs\obspy\lib\site-packages\notebook\notebookapp.py", line 78, in from .services.kernels.kernelmanager import MappingKernelManager, AsyncMappingKernelManager File "C:\Users\UPLC\anaconda3\envs\obspy\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 18, in from jupyter_client.session import Session File "C:\Users\UPLC\anaconda3\envs\obspy\lib\site-packages\jupyter_client__init__.py", line 6, in from .asynchronous import AsyncKernelClient # noqa File "C:\Users\UPLC\anaconda3\envs\obspy\lib\site-packages\jupyter_client\asynchronous__init__.py", line 1, in from .client import AsyncKernelClient # noqa File "C:\Users\UPLC\anaconda3\envs\obspy\lib\site-packages\jupyter_client\asynchronous\client.py", line 6, in from jupyter_client.channels import HBChannel File "C:\Users\UPLC\anaconda3\envs\obspy\lib\site-packages\jupyter_client\channels.py", line 12, in import zmq.asyncio ModuleNotFoundError: No module named 'zmq.asyncio'

minrk commented 2 years ago

If you don't have zmq.asyncio, you don't actually have pyzmq 22.3, or the install was corrupted somehow. Reinstalling may help:

conda install -n obspy pyzmq

To diagnose, try:

conda list -n obspy

or in Python:

import zmq
print(zmq.__version__, zmq.__file__)

Those might give you a hint about what's amiss.

elcolie commented 1 year ago

FYI: With Python 3.11.3 I don't have this problem. But when I use 3.10.9 I got this error.