2017-06-29 62 views
0

我無法用Python 3打開jupyter筆記本。我安裝了用於Python 2的Anaconda和用於安裝Python 3的Anaconda(兩者都是64位的Windows)。如果我爲Python 2運行jupyter notebook,一切正常,但使用Python 3則無法正常工作。我已經重新安裝了Anaconda 3(4.2版本= Python 3.5),但沒有幫助。我也嘗試了所有的谷歌結果。當我從anacoda提示符運行jupyter筆記本時,仍然出現以下錯誤。任何幫助,高度讚賞。Jupyter筆記本與python 3沒有運行

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

回答

0

我找到了一個適合我的解決方案。 在python3中重新安裝pyzmq

如果你們中的任何一個人有同樣的問題,我希望能幫助解決它。

1
pip uninstall pyzmq 

後這樣做

pip install pyzmq. 

感謝Muten_Roshi。 這種方法很好。