gpt4 book ai didi

python - iPython 给我一个语法错误

转载 作者:太空宇宙 更新时间:2023-11-04 09:46:01 25 4
gpt4 key购买 nike

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

现在符号链接(symbolic link)位于 /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

最佳答案

iPython 从版本 0.11 开始不再支持 python < 2.6,你必须从存档中安装 0.10(甚至可能是 0.9):

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

关于python - iPython 给我一个语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16226130/

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