win10下 Jupyter Notebook不运行python 3怎么办?

Jupyter Notebook不运行python 3怎么办?

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

我已经安装了Python 2的Anaconda和Python 3的Anaconda(Windows都安装了64位)。如果我用 Jupyter Notebook 运行Python 2 一切都很好,但是对于Python 3,它不起作用。我已经重新安装了Anaconda 3(4.2版本=Python3.5),但这没有帮助。

(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'


后来通过网友帮助,解决方法如下:

可以重新安装pyzmq中的python 3。

 

 
用户回答回答于 2018-08-012018-08-01 08:39:32
    pip uninstall pyzmq 

然后:

    pip install pyzmq.
 
posted @ 2018-10-25 22:14  中国人醒来了  阅读(5349)  评论(0编辑  收藏  举报