gpt4 book ai didi

python - 运行 ipython 笔记本时缺少 pyzmq

转载 作者:IT老高 更新时间:2023-10-28 21:57:28 25 4
gpt4 key购买 nike

我可以运行 iPython,但是当我尝试启动笔记本时,我收到以下错误:

~  ipython notebook                   
Traceback (most recent call last):
File "/usr/local/bin/ipython", line 8, in <module>
load_entry_point('ipython==2.1.0', 'console_scripts', 'ipython')()
File "/Library/Python/2.7/site-packages/ipython-2.1.0-py2.7.egg/IPython/__init__.py", line 120, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
File "/Library/Python/2.7/site-packages/ipython-2.1.0-py2.7.egg/IPython/config/application.py", line 563, in launch_instance
app.initialize(argv)
File "<string>", line 2, in initialize
File "/Library/Python/2.7/site-packages/ipython-2.1.0-py2.7.egg/IPython/config/application.py", line 92, in catch_config_error
return method(app, *args, **kwargs)
File "/Library/Python/2.7/site-packages/ipython-2.1.0-py2.7.egg/IPython/terminal/ipapp.py", line 321, in initialize
super(TerminalIPythonApp, self).initialize(argv)
File "<string>", line 2, in initialize
File "/Library/Python/2.7/site-packages/ipython-2.1.0-py2.7.egg/IPython/config/application.py", line 92, in catch_config_error
return method(app, *args, **kwargs)
File "/Library/Python/2.7/site-packages/ipython-2.1.0-py2.7.egg/IPython/core/application.py", line 381, in initialize
self.parse_command_line(argv)
File "/Library/Python/2.7/site-packages/ipython-2.1.0-py2.7.egg/IPython/terminal/ipapp.py", line 316, in parse_command_line
return super(TerminalIPythonApp, self).parse_command_line(argv)
File "<string>", line 2, in parse_command_line
File "/Library/Python/2.7/site-packages/ipython-2.1.0-py2.7.egg/IPython/config/application.py", line 92, in catch_config_error
return method(app, *args, **kwargs)
File "/Library/Python/2.7/site-packages/ipython-2.1.0-py2.7.egg/IPython/config/application.py", line 475, in parse_command_line
return self.initialize_subcommand(subc, subargv)
File "<string>", line 2, in initialize_subcommand
File "/Library/Python/2.7/site-packages/ipython-2.1.0-py2.7.egg/IPython/config/application.py", line 92, in catch_config_error
return method(app, *args, **kwargs)
File "/Library/Python/2.7/site-packages/ipython-2.1.0-py2.7.egg/IPython/config/application.py", line 406, in initialize_subcommand
subapp = import_item(subapp)
File "/Library/Python/2.7/site-packages/ipython-2.1.0-py2.7.egg/IPython/utils/importstring.py", line 42, in import_item
module = __import__(package, fromlist=[obj])
File "/Library/Python/2.7/site-packages/ipython-2.1.0-py2.7.egg/IPython/html/notebookapp.py", line 39, in <module>
check_for_zmq('2.1.11', 'IPython.html')
File "/Library/Python/2.7/site-packages/ipython-2.1.0-py2.7.egg/IPython/utils/zmqrelated.py", line 37, in check_for_zmq
raise ImportError("%s requires pyzmq >= %s"%(required_by, minimum_version))
ImportError: IPython.html requires pyzmq >= 2.1.11

但据我所知,我已经安装了 pyzmq 包。

~ pip install pyzmq            
Requirement already satisfied (use --upgrade to upgrade): pyzmq in /Library/Python/2.7/site-packages/pyzmq-14.3.1-py2.7-macosx-10.6-intel.egg
Cleaning up...

最佳答案

精氨酸。 ipython 安装有 pip 特殊。为了解决这个问题,我必须做以下事情:

$ pip uninstall ipython
$ pip install "ipython[all]"

问题是笔记本有自己的一组依赖项,这些依赖项没有通过 pip install ipython 安装。但是,在安装了 ipython 之后,如果您尝试使用 [all] 表单,pip 将不需要添加任何内容。

正如一些 shell(例如 zsh)的评论中提到的,有必要转义或引用方括号(pip install ipython\[all\] 也可以)。

关于python - 运行 ipython 笔记本时缺少 pyzmq,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24995438/

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