2015-12-08 32 views
0

安裝後,我安裝的IPython和IPython的筆記本的Python3.4版本Ipython3筆記本不運行帶有MacPorts的

sudo port install py34-ipython 
sudo port install py34-notebook 

目前我使用Python 3.4.3作爲我的版本Python3的。

如果我使用ipython3 notebook,則會彈出Web瀏覽器。但是,如果我嘗試打開一個新的筆記本電腦,內核會立即關閉。

$ipython3 notebook 
[W 18:02:47.712 NotebookApp] ipywidgets package not installed. Widgets are unavailable. 
[I 18:02:47.727 NotebookApp] Serving notebooks from local directory: /Users/MYNAME 
[I 18:02:47.727 NotebookApp] 0 active kernels 
[I 18:02:47.727 NotebookApp] The IPython Notebook is running at: http://localhost:8888/ 
[I 18:02:47.727 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). 
[I 18:03:27.826 NotebookApp] Creating new notebook in 
[W 18:03:28.518 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20151208180247 (::1) 9.24ms referer=http://localhost:8888/notebooks/Untitled67.ipynb?kernel_name=python3 
[I 18:03:28.693 NotebookApp] Kernel started: bccd5587-5da7-47a3-9c8f-90947b4140eb 
Traceback (most recent call last): 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/runpy.py", line 151, in _run_module_as_main 
    mod_name, mod_spec, code = _get_module_details(mod_name) 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/runpy.py", line 118, in _get_module_details 
    return _get_module_details(pkg_main_name) 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/runpy.py", line 104, in _get_module_details 
    spec = importlib.util.find_spec(mod_name) 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/importlib/util.py", line 86, in find_spec 
    parent = __import__(parent_name, fromlist=['__path__']) 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/ipykernel/__init__.py", line 2, in <module> 
    from .connect import * 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/ipykernel/connect.py", line 17, in <module> 
    import jupyter_client 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/jupyter_client/__init__.py", line 7, in <module> 
    from .manager import KernelManager, run_kernel 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/jupyter_client/manager.py", line 32, in <module> 
    from .session import Session 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/jupyter_client/session.py", line 48, in <module> 
    from zmq.eventloop.ioloop import IOLoop 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/zmq/eventloop/__init__.py", line 3, in <module> 
    from zmq.eventloop.ioloop import IOLoop 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/zmq/eventloop/ioloop.py", line 35, in <module> 
    from tornado.ioloop import PollIOLoop, PeriodicCallback 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/tornado/ioloop.py", line 57, in <module> 
    import thread # py2 
    File "/Users/MYNAME/thread.py", line 10 
    print old, new 
      ^
SyntaxError: Missing parentheses in call to 'print' 
[I 18:03:31.692 NotebookApp] KernelRestarter: restarting kernel (1/5) 

回答

0

文件/Users/MYNAME/thread.py是Python 2語法。 更改爲其他目錄或刪除此文件或更改此文件的名稱。然後再次啓動筆記本服務器。名稱thread.py對Python 2中標準庫模塊的名稱有影響.IPython與Python 2和3一起使用相同的源代碼運行並導入錯誤的文件。

+0

我正在使用Macports安裝兩個版本。也許我應該將它們安裝在單獨的目錄中... – ShanZhengYang

+0

您是否在我的答案中執行了這些步驟並且它們是否工作? –

+0

那麼,因爲我想使用macports來安裝兩個,因爲我想使用這個包管理器來保持所有模塊更新。我現在還不確定該怎麼做......也許我應該將此報告爲一個錯誤。 – ShanZhengYang

相關問題