Ipython3 笔记本在安装 macports 后没有 运行
Ipython3 notebook doesn't run after installed with macports
我用
安装了 Python3.4 版本的 IPython 和 Ipython 笔记本
sudo port install py34-ipython
sudo port install py34-notebook
目前我使用 Python 3.4.3 作为我的 Python3 版本。
如果我使用 ipython3 notebook
,网络浏览器会弹出。但是,如果我尝试打开一个新笔记本,内核会立即关闭。
$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)
文件 /Users/MYNAME/thread.py
使用 Python 2 语法。
更改到不同的目录或删除此文件或更改此文件的名称。然后再次启动笔记本服务器。名称 thread.py
隐藏了 Python 2 中标准库模块的名称。IPython 与 Python 2 和 3 一起运行,具有相同的源代码并导入了错误的文件。
我用
安装了 Python3.4 版本的 IPython 和 Ipython 笔记本sudo port install py34-ipython
sudo port install py34-notebook
目前我使用 Python 3.4.3 作为我的 Python3 版本。
如果我使用 ipython3 notebook
,网络浏览器会弹出。但是,如果我尝试打开一个新笔记本,内核会立即关闭。
$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)
文件 /Users/MYNAME/thread.py
使用 Python 2 语法。
更改到不同的目录或删除此文件或更改此文件的名称。然后再次启动笔记本服务器。名称 thread.py
隐藏了 Python 2 中标准库模块的名称。IPython 与 Python 2 和 3 一起运行,具有相同的源代码并导入了错误的文件。