notebook: unable to start Jupyter notebook
Hi, I’m not able to launch the jupyter notebook:
Traceback (most recent call last):
File "/usr/local/bin/jupyter-notebook", line 7, in <module>
from notebook.notebookapp import main
File "/usr/local/lib/python2.7/dist-packages/notebook/notebookapp.py", line 32, in <module>
from zmq.eventloop import ioloop
File "/usr/local/lib/python2.7/dist-packages/zmq/__init__.py", line 66, in <module>
from zmq import backend
File "/usr/local/lib/python2.7/dist-packages/zmq/backend/__init__.py", line 41, in <module>
reraise(*exc_info)
File "/usr/local/lib/python2.7/dist-packages/zmq/utils/sixcerpt.py", line 34, in reraise
raise value
File "/usr/local/lib/python2.7/dist-packages/zmq/backend/__init__.py", line 29, in <module>
_ns = select_backend(first)
Traceback (most recent call last):
File "/usr/local/bin/jupyter-notebook", line 7, in <module>
from notebook.notebookapp import main
File "/usr/local/lib/python2.7/dist-packages/notebook/notebookapp.py", line 32, in <module>
from zmq.eventloop import ioloop
File "/usr/local/lib/python2.7/dist-packages/zmq/__init__.py", line 66, in <module>
from zmq import backend
File "/usr/local/lib/python2.7/dist-packages/zmq/backend/__init__.py", line 41, in <module>
reraise(*exc_info)
File "/usr/local/lib/python2.7/dist-packages/zmq/utils/sixcerpt.py", line 34, in reraise
raise value
File "/usr/local/lib/python2.7/dist-packages/zmq/backend/__init__.py", line 29, in <module>
_ns = select_backend(first)
File "/usr/local/lib/python2.7/dist-packages/zmq/backend/select.py", line 27, in select_backend
mod = __import__(name, fromlist=public_api)
File "/usr/local/lib/python2.7/dist-packages/zmq/backend/cython/__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: /usr/local/lib/python2.7/dist-packages/zmq/backend/cython/constants.so: undefined symbol: PyUnicodeUCS4_DecodeUTF8
It was working a few months ago. I just upgraded it.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 7
- Comments: 34 (9 by maintainers)
Try uninstalling and reinstalling pyzmq.
This works for me
jupyter notebook --generate-configSuccess. Thank you!
Okay, I just spent two hours trying to fix this annoying issue. I built zeromq from source and it tells me something about libsodium so I installed that. Then, zeromq built succesfully. Great. Then, I fire up my jupyter notebook and still same message.
Then, I commented out: export PYTHONPATH=/usr/local/lib/python2.7/dist packages:$PYTHONPATH and I get the following message:
By this time, I am just done with this so decide to use anaconda for python 3. And, I get the same message as posted above! If anaconda is supposed to be isolated environment and it installed successfully and path was set to it then I would expect it to work. Now, I will go back to my distro. Note that I have both Python 2 and 3. What info do you need?
That looks like jupyter_environment_kernels is partly installed. If you need help working it out, post an issue there.
Solution:
conda create -n py35 python=3.5 anaconda
I simply create a new environment using the full anaconda metapackage. And it works.
Thanks for the reply! I may have worded not clearly enough: I CANNOT use Anaconda, as it’s not available on the Jetson. I edited the message above to be clearer.
Tried
sudo pip3 install --force-reinstall --upgrade pyzmqto no avail. Though forcing still gettingNot uninstalling pyzmq at /usr/lib/python3/dist-packages, outside environment /usrWell if you are using anaconda. Then open the Anaconda Navigator and then just update the Jupyter notebook app. It worked for me. After all the hassle of trying to solve just a simple app update worked on Anaconda. If that still doesn’t work then try reinstalling.
uninstall pyzmq and then reinstall using wheel file from here works for me.
Hi, I am having troubles with the same problem:
Traceback (most recent call last): File “/Library/Frameworks/Python.framework/Versions/3.5/bin/jupyter-notebook”, line 7, in <module> from notebook.notebookapp import main File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/notebook/notebookapp.py”, line 31, in <module> from zmq.eventloop import ioloop File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/zmq/init.py”, line 34, in <module> from zmq import backend File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/zmq/backend/init.py”, line 40, in <module> reraise(*exc_info) File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/zmq/utils/sixcerpt.py”, line 34, in reraise raise value File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/zmq/backend/init.py”, line 27, in <module> _ns = select_backend(first) File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/zmq/backend/select.py”, line 27, in select_backend mod = import(name, fromlist=public_api) File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/zmq/backend/cython/init.py”, line 6, in <module> from . import (constants, error, message, context, ImportError: cannot import name ‘constants’
Ok, let’s try to do things stem by step, I include what I get for information. If you get something too different or are unsure, ask at the specific step and we can go into more details.
List all kernels:
you can remove the folders of the kernels you do not want.
Find which python
jupyteruses:This is the python that have ZMQ installed.
Find which python IPython uses"
Check that the above python we just got does indeed have ZMQ:
If we have ZMQ try to install the kernel with this particuart python and give it a specific name just to find it easily
It should appear in the kernel list:
And in the
newdropdown menu in the notebook.Oh, you seem to be in a weird corner case/ have bad luck:
I see in one message that you are missing one package that you probably configured manually (ipymd), check in your config if you have
c.NotebookApp.contents_manager_class = 'ipymd.IPymdContentsManager', if so comment it, we can reinstall it later and retry. The part of the error:Like ly the config file will be in
~/.jupyter/jupyter_notebook_config.py(you can check withjupyter --config-dir)The only difference is that the Jupyter/IPython config is global, so if you have a issue in your config this might happen. This is needed as users might want to run only on server with various conda env
Anaconda will also only provide isolation if you are using bash, and don’t mess with $PATH in a way that anaconda can’t prevent. Typically it needs to shell-out to some external programs. And if $PATH is not correct, it can’t know.
Anyway, if it works by commenting the config, we can try to reinstall
ipymdin the right environment to get you set up again.Sorry for the trouble you are encountering.