简体   繁体   English

自从在Mac OS X Yosemite上安装python 3之后,ipython Notebook无法启动

[英]ipython notebook does not launch since installing python 3 on mac os x yosemite

I was enjoying my ipython notebook on my MacPro running OS X Yosemite, which was running python 2.7. 我在运行OS X Yosemite(运行python 2.7)的MacPro上欣赏我的ipython笔记本。

Then, I installed python 3.4, but forgot to double click the "Update Shell Profile.command" file in the Applications/Python3.4 folder. 然后,我安装了python 3.4,但忘了双击Applications / Python3.4文件夹中的“ Update Shell Profile.command”文件。

When I ran ipython notebook afterward, I noticed that I could choose between python 2.7 and python 3 kernels. 之后,当我运行ipython Notebook时,我注意到可以在python 2.7和python 3内核之间进行选择。 When I chose the python 3 kernel, it would try to start, but die. 当我选择python 3内核时,它将尝试启动但死了。

I shutdown my ipython notebook, and the next time I tried to launch it, I received the following errors: 我关闭了我的ipython笔记本,下次尝试启动它时,收到以下错误:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.4/bin/ipython", line 11, in sys.exit(start_ipython()) File "/Library/Python/2.7/site-packages/IPython/ init .py", line 118, in start_ipython return launch_new_instance(argv=argv, **kwargs) File "/Library/Python/2.7/site-packages/traitlets/config/application.py", line 591, in launch_instance app.initialize(argv) File "", line 2, in initialize File "/Library/Python/2.7/site-packages/traitlets/config/application.py", line 75, in catch_config_error return method(app, *args, **kwargs) File "/Library/Python/2.7/site-packages/IPython/terminal/ipapp.py", line 305, in initialize super(TerminalIPythonApp, self).initialize(argv) File "", line 2, in initialize File "/Library/Python/2.7/site-packages/traitlets/config/application.py", line 75, in catch_config_error return method(app, *args, **kwargs) File "/Library/Python/2.7/site-packages/IPython/core/application.py", line 386, in initialize self.parse_command_ 追溯(最近一次通话最近):文件“ /Library/Frameworks/Python.framework/Versions/3.4/bin/ipython”,第11行,位于sys.exit(start_ipython())中,文件“ /Library/Python/2.7/site -packages / IPython / init .py“,第118行,在start_ipython中,返回launch_new_instance(argv = argv,** kwargs)文件“ /Library/Python/2.7/site-packages/traitlets/config/application.py”,第591行,在launch_instance app.initialize(argv)文件“”的第2行中,在初始化文件“ /Library/Python/2.7/site-packages/traitlets/config/application.py”的第75行中,在catch_config_error返回方法中(应用, * args,** kwargs)文件“ /Library/Python/2.7/site-packages/IPython/terminal/ipapp.py”,第305行,在初始化super(TerminalIPythonApp,self)中。initialize(argv)文件“”,行2,在catch_config_error返回方法(应用程序,* args,** kwargs)的初始化文件“ /Library/Python/2.7/site-packages/traitlets/config/application.py”的第75行中,文件“ / Library / Python /初始化self.parse_command_中的2.7 / site-packages / IPython / core / application.py“,行386 line(argv) File "/Library/Python/2.7/site-packages/IPython/terminal/ipapp.py", line 300, in parse_command_line return super(TerminalIPythonApp, self).parse_command_line(argv) File "", line 2, in parse_command_line File "/Library/Python/2.7/site-packages/traitlets/config/application.py", line 75, in catch_config_error return method(app, *args, **kwargs) File "/Library/Python/2.7/site-packages/traitlets/config/application.py", line 487, in parse_command_line return self.initialize_subcommand(subc, subargv) File "", line 2, in initialize_subcommand File "/Library/Python/2.7/site-packages/traitlets/config/application.py", line 75, in catch_config_error return method(app, *args, **kwargs) File "/Library/Python/2.7/site-packages/traitlets/config/application.py", line 418, in initialize_subcommand subapp = import_item(subapp) File "/Library/Python/2.7/site-packages/ipython_genutils/importstring.py", line 31, in import_item module = import (package, fromlist=[obj]) File "/Library/Python/2.7/si 第(argv)行文件“ /Library/Python/2.7/site-packages/IPython/terminal/ipapp.py”,第300行,在parse_command_line中返回超级(TerminalIPythonApp,self)。parse_command_line(argv)文件“”,第2行,在parse_command_line文件“ /Library/Python/2.7/site-packages/traitlets/config/application.py”的第75行中,在catch_config_error返回方法(app,* args,** kwargs)中的文件“ /Library/Python/2.7/ parse_command_line中第487行的“ site-packages / traitlets / config / application.py”,返回返回self.initialize_subcommand(subc,subargv)文件“”,initialize_subcommand文件中的第2行,“ / Library / Python / 2.7 / site-packages / traitlets” /config/application.py“,第75行,在catch_config_error返回方法中(app,* args,** kwargs)文件” /Library/Python/2.7/site-packages/traitlets/config/application.py“,第418行,在initialize_subcommand中,subapp = import_item(subapp)文件“ /Library/Python/2.7/site-packages/ipython_genutils/importstring.py”,第31行,在import_item模块中= import (package,fromlist = [obj])文件“ / Library /的Python / 2.7 / SI te-packages/notebook/notebookapp.py", line 32, in from zmq.eventloop import ioloop File "/Library/Python/2.7/site-packages/zmq/ init .py", line 44, in _libsodium = ctypes.CDLL(bundled_sodium[0], mode=ctypes.RTLD_GLOBAL) File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/ctypes/ init .py", line 351, in init self._handle = _dlopen(self._name, mode) OSError: dlopen(/Library/Python/2.7/site-packages/zmq/libsodium.so.orig, 10): Symbol not found: _Py_InitModule4_64 Referenced from: /Library/Python/2.7/site-packages/zmq/libsodium.so.orig Expected in: flat namespace in /Library/Python/2.7/site-packages/zmq/libsodium.so.orig te-packages / notebook / notebookapp.py”,第32行,来自zmq.eventloop导入ioloop文件“ /Library/Python/2.7/site-packages/zmq/ init .py”,第44行,在_libsodium = ctypes.CDLL中(bundled_sodium [0],mode = ctypes.RTLD_GLOBAL),文件“ /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/ctypes/ init .py”,第351行, init self._handle = _dlopen (self._name,mode)OSError:dlopen(/Library/Python/2.7/site-packages/zmq/libsodium.so.orig,10):找不到符号:_Py_InitModule4_64引用自:/Library/Python/2.7/site- packages / zmq / libsodium.so.orig预期格式:/Library/Python/2.7/site-packages/zmq/libsodium.so.orig中的平面命名空间

I've uninstalled ipython, deleted the .ipython directory, and then reinstalled ipython to no avail. 我已经卸载了ipython,删除了.ipython目录,然后重新安装了ipython无济于事。

Any advice would be very welcome. 任何建议都将非常受欢迎。

Andy 安迪

I had the same problem and the following procedure worked for me: 我遇到了同样的问题,以下过程对我有用:

  1. uninstall the 2.7 version found in: 卸载以下版本中的2.7版本:

    ~/Library/Frameworks/Python.Framework/Versions 〜/资源库/框架/ Python.Framework /版本

  2. Download the Mac installer for Python 2.7.10 found here: Mac Python Downloads 在此处下载适用于Python 2.7.10的Mac安装程序: Mac Python下载

Then, as a test, try launching IPython from Terminal.app by typing 然后,作为测试,尝试通过键入以下内容从Terminal.app启动IPython:

$ipython

If that is successful, then try launching an IPython notebook from Terminal 如果成功,请尝试从终端启动IPython笔记本

$ipython notebook 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM