notebook: zmq: Can not launch jupyter notebook
Hi,
conda activate base
jupyter notebook
Gives me this message:
Traceback (most recent call last):
File "/home/ics_vr/anaconda3/bin/jupyter-notebook", line 7, in <module>
from notebook.notebookapp import main
File "/home/ics_vr/anaconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 44, in <module>
from zmq.eventloop import ioloop
File "/usr/local/lib/python3.5/dist-packages/zmq/__init__.py", line 47, in <module>
from zmq import backend
File "/usr/local/lib/python3.5/dist-packages/zmq/backend/__init__.py", line 40, in <module>
reraise(*exc_info)
File "/usr/local/lib/python3.5/dist-packages/zmq/utils/sixcerpt.py", line 34, in reraise
raise value
File "/usr/local/lib/python3.5/dist-packages/zmq/backend/__init__.py", line 27, in <module>
_ns = select_backend(first)
File "/usr/local/lib/python3.5/dist-packages/zmq/backend/select.py", line 26, in select_backend
mod = __import__(name, fromlist=public_api)
File "/usr/local/lib/python3.5/dist-packages/zmq/backend/cython/__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: cannot import name 'constants'
I did pip install pyzmq --install-option="--zmq=bundled", but not works.
I did conda install -c anaconda pyzmq, also not works.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 51 (3 by maintainers)
Hey , use the following: pip uninstall pyzmq pip install pyzmq
The thing with conda is that it has a lot of conflicts, you might be having a conflict. Using simple pip command would help you to remove those conflicts. I mean it worked for me. I hope it helps
This helped me solve the problem! Many thanks!
You should be using Anaconda prompt, which is installed by default with Anaconda. And the command should be here:
conda uninstall pyzmqand thenconda install pyzmq.It worked for me. When I installed Jupyter Notebooks to a new environment in Anaconda, it updated some other packages. I needed to uninstall pyzmq from Anaconda and reinstall it. The packages were downgraded and now it works fine.
pip uninstall pyzmq pip install pyzmq did not work for me. I tried :- pip install --upgrade pyzmq jupyterlab jupyter --force-reinstall use --user if not using a virtual environment in conda or virtualenv
Get pip here: https://bootstrap.pypa.io/get-pip.py Run the following command: python get-pip.py
You can verify that Pip was installed correctly by opening a command prompt and entering the following command: pip -V
Now that Pip is installed and configured, you can begin using it:
pip uninstall pyzmq pip uninstall jsonschema pip install pyzmq pip install jsonschema
Its works for me!
I have the same issue, I am no able to launch Jupyter notebook. It errors out. I tried a) pip uninstall pyzmq - it errors with access denied. I am new and I am afraid, I am in trouble please help. I may have to manually uninstall everything and then reinstall.
C:\ProgramData\Anaconda3\Scripts>pip uninstall pyzmq Uninstalling pyzmq-17.1.2: Would remove: c:\programdata\anaconda3\lib\site-packages\pyzmq-17.1.2-py3.7.egg-info c:\programdata\anaconda3\lib\site-packages\zmq* Would not remove (might be manually added): c:\programdata\anaconda3\lib\site-packages\zmq\backend\cffi_pycache__cffi_ext.c Proceed (y/n)? y Exception: Traceback (most recent call last): File “C:\ProgramData\Anaconda3\lib\shutil.py”, line 557, in move os.rename(src, real_dst) PermissionError: [WinError 5] Access is denied: ‘c:\programdata\anaconda3\lib\site-packages\pyzmq-17.1.2-py3.7.egg-info’ -> ‘C:\Users\Rajan\AppData\Local\Temp\pip-uninstall-n9lr8nr4\programdata\anaconda3\lib\site-packages\pyzmq-17.1.2-py3.7.egg-info’
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “C:\ProgramData\Anaconda3\lib\site-packages\pip_internal\basecommand.py”, line 228, in main status = self.run(options, args) File “C:\ProgramData\Anaconda3\lib\site-packages\pip_internal\commands\uninstall.py”, line 68, in run auto_confirm=options.yes, verbose=self.verbosity > 0, File “C:\ProgramData\Anaconda3\lib\site-packages\pip_internal\req\req_install.py”, line 661, in uninstall uninstalled_pathset.remove(auto_confirm, verbose) File “C:\ProgramData\Anaconda3\lib\site-packages\pip_internal\req\req_uninstall.py”, line 219, in remove renames(path, new_path) File “C:\ProgramData\Anaconda3\lib\site-packages\pip_internal\utils\misc.py”, line 273, in renames shutil.move(old, new) File “C:\ProgramData\Anaconda3\lib\shutil.py”, line 569, in move rmtree(src) File “C:\ProgramData\Anaconda3\lib\shutil.py”, line 507, in rmtree return _rmtree_unsafe(path, onerror) File “C:\ProgramData\Anaconda3\lib\shutil.py”, line 391, in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) File “C:\ProgramData\Anaconda3\lib\shutil.py”, line 389, in _rmtree_unsafe os.unlink(fullname) PermissionError: [WinError 5] Access is denied: ‘c:\programdata\anaconda3\lib\site-packages\pyzmq-17.1.2-py3.7.egg-info\dependency_links.txt’
C:\ProgramData\Anaconda3\Scripts>pip install pyzmq Requirement already satisfied: pyzmq in c:\programdata\anaconda3\lib\site-packages (17.1.2) twisted 18.7.0 requires PyHamcrest>=1.9.0, which is not installed. You are using pip version 10.0.1, however version 18.1 is available. You should consider upgrading via the ‘python -m pip install --upgrade pip’ command.
C:\ProgramData\Anaconda3\Scripts>python -m pip install --upgrade pip Requirement already up-to-date: pip in c:\python27\lib\site-packages (18.1)
thx. work for me on windows command prompt
Yeah, right now I could only start jupyter under the virtual environment installed with anaconda full meta package. Base and global is not able to use jupyter.
By the way, I think conda mix a lot of things.
Like if I install opencv globally and then install a different version in virtual environment, my opencv global will gives me segmentation fault, but it could be used in Base. Further, under the virtual env with diff. opencv, although everything installed, I mean you could fins cv2.so, and libopencv, but you have to cd the PATH to that python site packages, otherwise you are still using Base version opencv. The conda totally not easy my installation, just bring a lot of mess to my my setup work.
Could I ask you update your documentation with more detail instructions for using conda, if the conda mix so many things together.
thanks a lot it worked
Unable to launch Jupyter notebook. getting below error I tried below still not working pip uninstall pyzmq pip install pyzmq
Traceback (most recent call last): File “C:\anaconda1\Scripts\jupyter-notebook-script.py”, line 6, in from notebook.notebookapp import main File “C:\Users\pdeshpan\AppData\Roaming\Python\Python37\site-packages\notebook\notebookapp.py”, line 49, in from zmq.eventloop import ioloop File “C:\Users\pdeshpan\AppData\Roaming\Python\Python37\site-packages\zmq_init_.py”, line 47, in from zmq import backend File “C:\Users\pdeshpan\AppData\Roaming\Python\Python37\site-packages\zmq\backend_init_.py”, line 40, in reraise(*exc_info) File “C:\Users\pdeshpan\AppData\Roaming\Python\Python37\site-packages\zmq\utils\sixcerpt.py”, line 34, in reraise raise value File “C:\Users\pdeshpan\AppData\Roaming\Python\Python37\site-packages\zmq\backend_init_.py”, line 27, in ns = select_backend(first) File “C:\Users\pdeshpan\AppData\Roaming\Python\Python37\site-packages\zmq\backend\select.py”, line 28, in select_backend mod = import(name, fromlist=public_api) File "C:\Users\pdeshpan\AppData\Roaming\Python\Python37\site-packages\zmq\backend\cython_init.py", line 6, in from . import (constants, error, message, context, ImportError: cannot import name ‘constants’ from ‘zmq.backend.cython’ (C:\Users\pdeshpan\AppData\Roaming\Python\Python37\site-packages\zmq\backend\cython_init_.py)
Worked for me too! thanks
That work for me on anaconda prompt (win10): pip install --upgrade pyzmq jupyterlab jupyter --force-reinstall
I have installed Anaconda on an SSD drive. Launching Anaconda Navigator and then VSCode or Spyder was fine. Jupyter Notebook wouldn’t launch and gave the same error as the OP. Using ‘conda uninstall pyzmq’ uninstalled pyzmq and everything else in Navigator except VS Code. That was not expected. I then opened Anaconda Navigator and reinstalled Jupyter Notebook and got the same error as before. ie.
Reinstalling and launching Jupyter Lab gave:
Unless @minrk knows better, it looks like your installed package has got corrupted (possibly by mixing conda and pip usage). If so, probably the easiest thing is to remove and reinstall Anaconda.