Jupyter 笔记本打不开,distutils 错误

Jupyter notebook not opening, distutils error

我在命令提示符下输入 jupyter notebook(或 jupyter-notebook),但我得到的是:

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)

我所做的只是从网站上安装 Anaconda,我不确定为什么它不起作用。

编辑:

重复Jupyter Notebook error

你安装了吗? ;-)

如果您使用菜单快捷方式或 Anaconda 启动器启动它,请尝试打开终端或命令提示符,然后 运行 命令 jupyter notebook。

如果找不到jupyter,可能需要配置PATH环境变量。如果您不知道那是什么意思,也不想知道,只需(重新)使用默认设置安装 Anaconda,它应该正确设置 PATH。

如果 Jupyter 提示找不到笔记本,请使用 pip 或 conda 检查笔记本包是否已安装。

尝试 运行 jupyter-notebook(带连字符)。这通常应该与 jupyter notebook 相同(带有 space),但如果有任何不同,带有连字符的版本是“真正的”启动器,另一个包装它。

希望对你有帮助,因为它对我有帮助

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).

我也遇到了这个问题,貌似是和之前卸载的python冲突导致的。我删除了 C:\Users\AppData\Roaming 中的 Python 文件。现在我的笔记本可以正常使用了。

尝试在环境变量 C:\Users\palla\Anaconda3\Lib\site-packages\zmq.

中添加此路径

然后如果你得到任何 dll 错误意味着尝试添加这个路径 C:\Users\palla\Anaconda3\Library\bin