Joao Vilar
Joao Vilar

Reputation: 37

Jupyter notebook not opening, distutils error

I type jupyter notebook (or jupyter-notebook) on my command prompt but all I get is:

E:\Programas\Anaconda\lib\site-packages\setuptools\distutils_patch.py:25: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.
  warnings.warn(
_cffi_ext.c
AppData\Roaming\Python\Python38\site-packages\zmq\backend\cffi\__pycache__\_cffi_ext.c(266): fatal error C1083: Cannot open include file: 'sys/un.h': No such file or directory
Traceback (most recent call last):
  File "E:\Programas\Anaconda\Scripts\jupyter-notebook-script.py", line 6, in <module>
    from notebook.notebookapp import main
  File "C:\Users\joaom\AppData\Roaming\Python\Python38\site-packages\notebook\notebookapp.py", line 49, in <module>
    from zmq.eventloop import ioloop
  File "C:\Users\joaom\AppData\Roaming\Python\Python38\site-packages\zmq\__init__.py", line 47, in <module>
    from zmq import backend
  File "C:\Users\joaom\AppData\Roaming\Python\Python38\site-packages\zmq\backend\__init__.py", line 40, in <module>
    reraise(*exc_info)
  File "C:\Users\joaom\AppData\Roaming\Python\Python38\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
    raise value
  File "C:\Users\joaom\AppData\Roaming\Python\Python38\site-packages\zmq\backend\__init__.py", line 27, in <module>
    _ns = select_backend(first)
  File "C:\Users\joaom\AppData\Roaming\Python\Python38\site-packages\zmq\backend\select.py", line 28, in select_backend
    mod = __import__(name, fromlist=public_api)
  File "C:\Users\joaom\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\joaom\AppData\Roaming\Python\Python38\site-packages\zmq\backend\cython\__init__.py)

All I did was install Anaconda from the website, I'm not sure why it isn't working.

Edit:

Duplicate on Jupyter Notebook error

Upvotes: 2

Views: 6679

Answers (3)

Sai Charan
Sai Charan

Reputation: 66

Try adding this path in environment variables C:\Users\palla\Anaconda3\Lib\site-packages\zmq.

Then after if you get any dll error means try adding this path also C:\Users\palla\Anaconda3\Library\bin

Upvotes: 5

Nadiantara I Wayan
Nadiantara I Wayan

Reputation: 91

I've also got this issue, apparently, it's caused by a conflict with previously uninstalled python. I deleted Python file in C:\Users\AppData\Roaming. Now my Notebook works as usual.

Upvotes: 2

Zesty Dragon
Zesty Dragon

Reputation: 561

Have you installed it? ;-)

If you’re using a menu shortcut or Anaconda launcher to start it, try opening a terminal or command prompt and running the command jupyter notebook.

If it can’t find jupyter, you may need to configure your PATH environment variable. If you don’t know what that means, and don’t want to find out, just (re)install Anaconda with the default settings, and it should set up PATH correctly.

If Jupyter gives an error that it can’t find notebook, check with pip or conda that the notebook package is installed.

Try running jupyter-notebook (with a hyphen). This should normally be the same as jupyter notebook (with a space), but if there’s any difference, the version with the hyphen is the ‘real’ launcher, and the other one wraps that.

Hope it helps,AS it helped me

https://jupyter-notebook.readthedocs.io/en/stable/troubleshooting.html#:~:text=Jupyter%20fails%20to%20start,-Have%20you%20installed&text=If%20you're%20using%20a,configure%20your%20PATH%20environment%20variable.&text=Try%20running%20jupyter%2Dnotebook%20(with%20a%20hyphen).

Upvotes: 0

Related Questions