0

我在没有 sudo 权限的 CentOS 服务器上有一个帐户。因此,我尝试通过python setup.py prefix=<my home directory>.

但是,我得到了错误:

Traceback (most recent call last):
  File "/usr/bin/ipython", line 19, in <module>
    from IPython.frontend.terminal.ipapp import launch_new_instance
ImportError: No module named IPython.frontend.terminal.ipapp

我发现了一个和我一样的问题:IPython import failure and python sys.path in general

我按照提问者的指示将我的 IPython 的目录添加到 IPython 执行文件中。

#!/usr/bin/python
"""Terminal-based IPython entry point.
"""
import sys
sys.path.append("./Ipython directory")

from IPython.frontend.terminal.ipapp import launch_new_instance

launch_new_instance()

但是,我也遇到了同样的错误。所以我想知道如何正确启动 IPython?谢谢。

4

2 回答 2

0

您可能希望使用标志进行安装,该--user标志应sys.path自动将其打开。

python setup.py install --user

如果--prefix出于其他原因需要使用,请确保添加到的目录是包含sys.pathIPython 包的文件夹,而不是 IPython 目录。它可能会以“站点包”结尾。

于 2013-05-14T22:42:16.420 回答
0

我将IPython源文件夹复制到 ~/bin/. 的执行文件IPython可以识别模块,IPythonIPython shell 启动成功。

于 2013-05-16T09:27:47.823 回答