0

我现在正在运行 python 2.4 并将 iPython 安装到我的 ubuntu 机器上。我现在遇到的问题是,每当我尝试从终端启动它时,它都会给我一个 ImportError 。

现在符号链接已定位/usr/local/bin,实际文件在里面/usr/bin/

错误信息:

File "/usr/local/bin/ipython", line 9
except ImportError as e:
                    ^
SyntaxError: invalid syntax

iPython 文件...

#!/opt/ttools/bin/python ## YES THIS IS THE CORRECT PATH
"""Terminal-based IPython entry point.
"""

from IPython.frontend.terminal.ipapp import launch_new_instance

try:
  launch_new_instance()
except ImportError as e:
  if "qt.console.qtconsoleapp" in e.message:
    print "Could not start qtconsole. Please install ipython-qtconsole"
  elif "html.notebook.notebookapp" in e.message:
    print "Could not start notebook. Please install ipython-notebook"
  else:
    # if there is no clue on the cause -- just re-raise
    raise

当我不得不在我的mac上设置它时,我从来没有遇到过这样的问题......

任何帮助,将不胜感激。谢谢 !!

编辑::解决方案

下载http://archive.ipython.org/release/0.10.2/ipython-0.10.2-py2.6.egg

导航到下载文件夹并运行以下命令:

sudo easy_install ipython-0.10.2-py2.6.egg

4

1 回答 1

2

iPython 自 0.11 版以来不再支持 python < 2.6,您必须从存档中安装 0.10(甚至可能是 0.9):

http://archive.ipython.org/release/

于 2013-04-25T23:01:31.240 回答