我在 /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 install
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