gpt4 book ai didi

macos - 自从在Mac OS X Yosemite上安装python 3以来,ipython Notebook无法启动

转载 作者:行者123 更新时间:2023-12-03 16:10:07 26 4
gpt4 key购买 nike

我在运行OS X Yosemite(运行python 2.7)的MacPro上享受我的ipython笔记本。

然后,我安装了python 3.4,但忘了双击Applications / Python3.4文件夹中的“Update Shell Profile.command”文件。

之后,当我运行ipython Notebook时,我注意到可以在python 2.7和python 3内核之间进行选择。当我选择python 3内核时,它将尝试启动但死了。

我关闭了我的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_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/site-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



我已经卸载了ipython,删除了.ipython目录,然后重新安装了ipython无济于事。

任何建议都将非常受欢迎。

安迪

最佳答案

我遇到了同样的问题,以下过程对我有用:

  • 卸载以下版本中的2.7版本:

    〜/ Library / Frameworks / Python.Framework / Versions
  • 在此处下载适用于Python 2.7.10的Mac安装程序:
    Mac Python Downloads

  • 然后,作为测试,尝试通过键入以下内容从Terminal.app启动IPython:
    $ipython

    如果成功,请尝试从终端启动IPython笔记本
    $ipython notebook 

    关于macos - 自从在Mac OS X Yosemite上安装python 3以来,ipython Notebook无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32366081/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com