【问题标题】:Jupyter Notebook with python 3 not running没有运行 python 3 的 Jupyter Notebook
【发布时间】:2017-12-03 01:56:05
【问题描述】:

我无法使用 Python 3 打开 jupyter notebook。我安装了适用于 Python 2 的 Anaconda 和适用于 Python 3 的 Anaconda(Windows 均为 64 位)。如果我为 Python 2 运行 jupyter notebook 一切正常,但在 Python 3 中它不起作用。我已经重新安装了 Anaconda 3(4.2 版本 = Python 3.5),但这并没有帮助。我还尝试了所有的谷歌结果。当我从 anacoda 提示符运行 jupyter notebook 时,我仍然收到以下错误。非常感谢任何帮助。

(C:\Users\Myamoto\Anaconda3) C:\Users\Myamoto>jupyter notebook
_cffi_ext.c
AppData\Roaming\Python\Python35\site-packages\zmq\backend\cffi\__pycache__\_cffi_ext.c(209): fatal error C1083: Cannot open include file: 'sys/un.h': No such file or directory
Traceback (most recent call last):
  File "C:\Users\Myamoto\Anaconda3\Scripts\jupyter-notebook-script.py", line 3, in <module>
    import notebook.notebookapp
  File "C:\Users\Myamoto\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 31, in <module>
    from zmq.eventloop import ioloop
  File "C:\Users\Myamoto\AppData\Roaming\Python\Python35\site-packages\zmq\__init__.py", line 34, in <module>
    from zmq import backend
  File "C:\Users\Myamoto\AppData\Roaming\Python\Python35\site-packages\zmq\backend\__init__.py", line 40, in <module>
    reraise(*exc_info)
  File "C:\Users\Myamoto\AppData\Roaming\Python\Python35\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
    raise value
  File "C:\Users\Myamoto\AppData\Roaming\Python\Python35\site-packages\zmq\backend\__init__.py", line 27, in <module>
    _ns = select_backend(first)
  File "C:\Users\Myamoto\AppData\Roaming\Python\Python35\site-packages\zmq\backend\select.py", line 26, in select_backend
    mod = __import__(name, fromlist=public_api)
  File "C:\Users\Myamoto\AppData\Roaming\Python\Python35\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
    from . import (constants, error, message, context,
ImportError: cannot import name 'constants'

【问题讨论】:

    标签: python-3.x kernel jupyter-notebook jupyter


    【解决方案1】:
        pip uninstall pyzmq 
    

    做了之后

        pip install pyzmq.
    

    感谢 Muten_Roshi。 这个方法很好用。

    【讨论】:

      【解决方案2】:

      问题在于 pyzmq,但正在运行:

      pip uninstall pyzmq 
      

      可能会出现错误Cannot uninstall 'pyzmq'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

      如果您使用 Anaconda,这样的命令链可能会有所帮助(它实际上解决了我的问题):

      conda uninstall pyzmq 
      conda install pyzmq 
      conda install jupyter
      

      【讨论】:

        【解决方案3】:

        我在使用 spyder 时遇到了类似的问题。 我卸载了所有产生问题的软件包,也卸载了 spyder。

        Conda remove packages
        conda install packages 
        

        它又开始工作了。

        【讨论】:

          【解决方案4】:

          我找到了一个适合我的解决方案。 在 python3 中重新安装 pyzmq

          如果你们中的任何人遇到同样的问题,我希望这有助于解决它。

          【讨论】:

            猜你喜欢
            • 2018-02-21
            • 1970-01-01
            • 2023-03-08
            • 1970-01-01
            • 2019-03-22
            • 1970-01-01
            • 2016-11-02
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多