简体   繁体   English

Jupyter 笔记本打不开,distutils 错误

[英]Jupyter notebook not opening, distutils error

I type jupyter notebook (or jupyter-notebook) on my command prompt but all I get is:我在命令提示符下键入 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)

All I did was install Anaconda from the website, I'm not sure why it isn't working.我所做的只是从网站上安装 Anaconda,我不确定它为什么不起作用。

Edit:编辑:

Duplicate on Jupyter Notebook error重复Jupyter Notebook 错误

Try adding this path in environment variables C:\Users\palla\Anaconda3\Lib\site-packages\zmq.尝试在环境变量 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然后,如果您收到任何 dll 错误意味着尝试添加此路径 C:\Users\palla\Anaconda3\Library\bin

I've also got this issue, apparently, it's caused by a conflict with previously uninstalled python.我也遇到了这个问题,显然是由于与之前卸载的 python 冲突引起的。 I deleted Python file in C:\Users\AppData\Roaming.我删除了 C:\Users\AppData\Roaming 中的 Python 文件。 Now my Notebook works as usual.现在我的笔记本照常工作。

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.如果您使用菜单快捷方式或 Anaconda 启动器来启动它,请尝试打开终端或命令提示符并运行命令 jupyter notebook。

If it can't find jupyter, you may need to configure your PATH environment variable.如果找不到 jupyter,则可能需要配置 PATH 环境变量。 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.如果您不知道这意味着什么,并且不想知道,只需(重新)使用默认设置安装 Anaconda,它应该正确设置 PATH。

If Jupyter gives an error that it can't find notebook, check with pip or conda that the notebook package is installed.如果 Jupyter 出现找不到笔记本的错误,请检查 pip 或 conda 是否安装了笔记本 package。

Try running jupyter-notebook (with a hyphen).尝试运行 jupyter-notebook(带连字符)。 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.这通常应该与 jupyter notebook 相同(带有空格),但如果有任何区别,带有连字符的版本是“真正的”启动器,另一个包装它。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM