gpt4 book ai didi

python - 导入错误 : cannot import name start_ipython

转载 作者:太空宇宙 更新时间:2023-11-03 12:08:14 25 4
gpt4 key购买 nike

我已经在/usr/lib/ipython-1.1.0 中提取了 ipython-1.1.0.tar.gz 并运行了以下命令来完成构建和安装:

root@my-laptop:/usr/lib/ipython-1.1.0# python setup.py build
root@my-laptop:/usr/lib/ipython-1.1.0# python setup.py install

我使用的是 Python 2.6,安装在/usr/bin/python2.6 下,我的其他包在/usr/lib/python2.6/site-packages/下

现在,当我尝试从 shell 命令启动 ipython notebook 时,我收到以下 ImportError 消息:

root@my-laptop:/usr/lib/ipython-1.1.0# ipython notebook
Traceback (most recent call last):
File "/usr/local/bin/ipython", line 5, in <module>
from IPython import start_ipython
ImportError: cannot import name start_ipython

当我尝试启动 README.rst 文件中提到的 IPython 实例时,我收到以下消息:

root@my-laptop:/usr/lib/ipython-1.1.0# python -m IPython
/usr/bin/python: IPython is a package and cannot be directly executed

我尝试了 easy_install 和 pip 安装

root@my-laptop:/usr/lib/ipython-1.1.0# easy_install ipython
Searching for ipython
Best match: ipython 1.1.0
Adding ipython 1.1.0 to easy-install.pth file

Using /usr/local/lib/python2.6/dist-packages
Processing dependencies for ipython
root@my-laptop:/usr/lib/ipython-1.1.0# pip install ipython
Requirement already satisfied: ipython in /usr/lib/pymodules/python2.6
Installing collected packages: ipython
Successfully installed ipython

但是ImportError问题依然没有解决。这不允许打开交互式 Python。

我在下面的链接中找到了一些解决方案,但不确定:

https://trac.macports.org/ticket/40119

最佳答案

我也遇到了这个问题。我们确定 IPython API 没有改变吗?我得到了一些看起来合适的东西:

import IPython
IPython.Shell.start()

编辑:好的,nvmind。我同时安装的另一个程序决定更改 PYTHONPATH。

关于python - 导入错误 : cannot import name start_ipython,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19262218/

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