Jupyter Notebook not launching (Anaconda) - python

When I try to launch Jupyter notebook through Anaconda, I get the following error message:
Traceback (most recent call last):
File "C:\Users\Michael\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in
from notebook.notebookapp import main
File "C:\Users\Michael\AppData\Roaming\Python\Python37\site-packages\notebook\notebookapp.py", line 49, in
from zmq.eventloop import ioloop
File "C:\Users\Michael\AppData\Roaming\Python\Python37\site-packages\zmq\__init__.py", line 47, in
from zmq import backend
File "C:\Users\Michael\AppData\Roaming\Python\Python37\site-packages\zmq\backend\__init__.py", line 40, in
reraise(*exc_info)
File "C:\Users\Michael\AppData\Roaming\Python\Python37\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\Michael\AppData\Roaming\Python\Python37\site-packages\zmq\backend\__init__.py", line 27, in
_ns = select_backend(first)
File "C:\Users\Michael\AppData\Roaming\Python\Python37\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\Michael\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\Michael\AppData\Roaming\Python\Python37\site-packages\zmq\backend\cython\__init__.py)
How do I go about fixing this? I already tried reinstalling Python and Jupyter (for what it's worth).

Try:
conda uninstall pyzmq
conda install pyzmq
or
pip uninstall pyzmq
pip install pyzmq
source: https://github.com/jupyter/notebook/issues/3435

Related

Import Error when installing python3 kernel for Jupyter Notebook

My python3 kernel for jupyter notebook was not starting, so I uninstalled it. I then ran these commands to create a new python3 kernel.
python3 -m pip install ipykernel
python3 -m ipykernel install --user
However, I get an error when running python3 -m ipykernel install --user.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/ipykernel/__init__.py", line 2, in <module>
from .connect import *
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/ipykernel/connect.py", line 11, in <module>
from IPython.core.profiledir import ProfileDir
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/IPython/__init__.py", line 56, in <module>
from .terminal.embed import embed
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/IPython/terminal/embed.py", line 16, in <module>
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/IPython/terminal/interactiveshell.py", line 19, in <module>
from prompt_toolkit.enums import DEFAULT_BUFFER, EditingMode
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/prompt_toolkit/__init__.py", line 16, in <module>
from .application import Application
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/prompt_toolkit/application/__init__.py", line 1, in <module>
from .application import Application
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/prompt_toolkit/application/application.py", line 42, in <module>
from prompt_toolkit.buffer import Buffer
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/prompt_toolkit/buffer.py", line 33, in <module>
from .auto_suggest import AutoSuggest, Suggestion
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/prompt_toolkit/auto_suggest.py", line 19, in <module>
from .document import Document
File "/Users/user1/Library/Python/3.6/lib/python/site-packages/prompt_toolkit/document.py", line 8, in <module>
from typing import (
ImportError: cannot import name 'NoReturn'
This is the same error I was getting with the original python3 kernel before I removed it. How can I solve this issue?
I solved this issue by uninstalling and reinstalling Anaconda.
It seems, like it's problem with python version, Typing.NoReturn is new for python 3.6.2.
Try to install prompt-toolkit with a lower version, for instance 2.0.10. It worked for me:
python3 -m pip install prompt-toolkit==2.0.10
Then try again:
python3 -m ipykernel install --user

Jupyter notebook does not launch

I installed Anaconda today, but have been facing issues to launch Jupyter notebook. I tried out solutions online, such as starting it from the command prompt, but nothing has worked.
When I try to open, it gives me this error:
Traceback (most recent call last): File
"C:\Users\Avi\anaconda3\Scripts\jupyter-notebook-script.py", line 6,
in
from notebook.notebookapp import main
File
"C:\Users\Avi\anaconda3\lib\site-packages\notebook\notebookapp.py",
line 51, in
from zmq.eventloop import ioloop
File
"C:\Users\Avi\AppData\Roaming\Python\Python38\site-packages\zmq_init_.py",
line 47, in
from zmq import backend
File
"C:\Users\Avi\AppData\Roaming\Python\Python38\site-packages\zmq\backend_init_.py",
line 40, in
reraise(*exc_info)
File
"C:\Users\Avi\AppData\Roaming\Python\Python38\site-packages\zmq\utils\sixcerpt.py",
line 34, in reraise
raise value
File
"C:\Users\Avi\AppData\Roaming\Python\Python38\site-packages\zmq\backend_init_.py",
line 27, in
_ns = select_backend(first)
File
"C:\Users\Avi\AppData\Roaming\Python\Python38\site-packages\zmq\backend\select.py",
line 28, in select_backend
mod = import(name, fromlist=public_api)
File
"C:\Users\Avi\AppData\Roaming\Python\Python38\site-packages\zmq\backend\cython_init_.py",
line 6, in
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\Avi\AppData\Roaming\Python\Python38\site-packages\zmq\backend\cython_init_.py)
Try to create a conda environment 'test' with a specific python environment, activate the environment and then run jupyter notebook. On anaconda prompt run the below commands.
conda create -n test "python>=3.5,<3.8" ipython
conda activate test
jupyter notebook

Jupyter is not launching from anaconda navigator after clicking so many times and i got this error

After installing Jupyter, it is not launching from anaconda navigator after clicking multiples times but still, I get this following error:
Traceback (most recent call last):
File "C:\Users\ising\anaconda3\envs\ml_python_2020\lib\site-packages\jupyterlab_server\server.py", line 20, in
from notebook.notebookapp import aliases, flags, NotebookApp as ServerApp
File "C:\Users\ising\anaconda3\envs\ml_python_2020\lib\site-packages\notebook\notebookapp.py", line 51, in
from zmq.eventloop import ioloop
File "C:\Users\ising\AppData\Roaming\Python\Python38\site-packages\zmq\__init__.py", line 50, in
from zmq import backend
File "C:\Users\ising\AppData\Roaming\Python\Python38\site-packages\zmq\backend\__init__.py", line 40, in
reraise(*exc_info)
File "C:\Users\ising\AppData\Roaming\Python\Python38\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\ising\AppData\Roaming\Python\Python38\site-packages\zmq\backend\__init__.py", line 27, in
_ns = select_backend(first)
File "C:\Users\ising\AppData\Roaming\Python\Python38\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\ising\AppData\Roaming\Python\Python38\site-packages\zmq\backend\cython\__init__.py", line 6, in
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\ising\AppData\Roaming\Python\Python38\site-packages\zmq\backend\cython\__init__.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\ising\anaconda3\envs\ml_python_2020\Scripts\jupyter-lab-script.py", line 5, in
from jupyterlab.labapp import main
File "C:\Users\ising\anaconda3\envs\ml_python_2020\lib\site-packages\jupyterlab\labapp.py", line 14, in
from jupyterlab_server import slugify, WORKSPACE_EXTENSION
File "C:\Users\ising\anaconda3\envs\ml_python_2020\lib\site-packages\jupyterlab_server\__init__.py", line 4, in
from .app import LabServerApp
File "C:\Users\ising\anaconda3\envs\ml_python_2020\lib\site-packages\jupyterlab_server\app.py", line 9, in
from .server import ServerApp
File "C:\Users\ising\anaconda3\envs\ml_python_2020\lib\site-packages\jupyterlab_server\server.py", line 26, in
from jupyter_server.base.handlers import ( # noqa
ModuleNotFoundError: No module named 'jupyter_server'
You just need to do this step
pip uninstall pyzmq
and after that
pip install pyzmq
go back to your anaconda-navigator and try to launch Jupyter lab and it'll work fine

jupyter notebook and spyder not launching from anaconda prompt.However it was working fine earlier. It is giving me the following error:

(base) C:\Users\Aakash\anaconda3>jupyter notebook
Traceback (most recent call last):
File "C:\Users\Aakash\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in
from notebook.notebookapp import main
File "C:\Users\Aakash\anaconda3\lib\site-packages\notebook\notebookapp.py", line 49, in
from zmq.eventloop import ioloop
File "C:\Users\Aakash\anaconda3\lib\site-packages\zmq__init__.py", line 47, in
from zmq import backend
File "C:\Users\Aakash\anaconda3\lib\site-packages\zmq\backend__init__.py", line 40, in
reraise(*exc_info)
File "C:\Users\Aakash\anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\Aakash\anaconda3\lib\site-packages\zmq\backend__init__.py", line 27, in
_ns = select_backend(first)
File "C:\Users\Aakash\anaconda3\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = import(name, fromlist=public_api)
File "C:\Users\Aakash\anaconda3\lib\site-packages\zmq\backend\cython__init__.py", line 6, in
from . import (constants, error, message, context,
ImportError: DLL load failed: The specified module could not be found.
Run these on anaconda prompt:
conda upgrade qt
OR
conda uninstall tornado
conda install tornado==6.0.4
OR
Check these previous answers
Anaconda Navigator Jupyter and Spyder won't start after successful installation

DLL Error when trying to launch Jupyter notebook

Getting below error when trying to launch jupyter notebook. Any help to address this error is appreciated.
_cffi_ext.c C:\Users\emathew004\anaconda3\lib\site-packages\zmq\backend\cffi__pycache___cffi_ext.c(213):
fatal error C1083: Cannot open include file: 'sys/un.h': No such file
or directory Traceback (most recent call last): File
"C:\Users\emathew004\anaconda3\Scripts\jupyter-notebook-script.py",
line 6, in
from notebook.notebookapp import main File "C:\Users\emathew004\anaconda3\lib\site-packages\notebook\notebookapp.py",
line 47, in
from zmq.eventloop import ioloop File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq__init__.py",
line 47, in
from zmq import backend File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq\backend__init__.py",
line 40, in
reraise(*exc_info) File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq\utils\sixcerpt.py",
line 34, in reraise
raise value File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq\backend__init__.py",
line 27, in
_ns = select_backend(first) File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq\backend\select.py",
line 28, in select_backend
mod = import(name, fromlist=public_api) File "C:\Users\emathew004\anaconda3\lib\site-packages\zmq\backend\cython__init__.py",
line 6, in
from . import (constants, error, message, context, ImportError: DLL load failed: The specified module could not be found
I've also had this problem, which I solved as follows.
conda uninstall pyzmq (uninstall pyzmq)
conda install pyzmq (reinstall pyzmq)
conda install jupyter (reinstall jupyter)
You need a corresponding version of visual c++ redistribution.

Categories

Resources