我无法使用Python 3打开jupyter笔记本。我安装了用于Python 2的Anaconda和用于Python 3的Anaconda (都是64位Windows版)。如果我在Python2上运行jupyter notebook,一切都正常,但在Python3上就不行了。我已经重新安装了Anaconda 3 (4.2版本=Python3.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'
发布于 2017-11-02 13:04:27
pip uninstall pyzmq
在那之后
pip install pyzmq.
感谢Muten_Roshi。这个方法工作得很好。
发布于 2018-04-20 03:37:08
问题出在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
发布于 2017-06-29 20:29:37
我找到了一个对我有效的解决方案。在python3中重新安装pyzmq
如果你们中的任何人有同样的问题,我希望这有助于解决它。
https://stackoverflow.com/questions/44823874
复制相似问题