【发布时间】:2020-04-09 15:24:40
【问题描述】:
我正在尝试下载适用于 Python 的 Turtle 图形包,因此我在我的 linux 终端中输入以下命令:
myusername@penguin:~/Pys$ pip3 install turtle
这是我遇到的错误:
Collecting turtle
Using cached https://files.pythonhosted.org/packages/ff/f0/21a42e9e424d24bdd0e509d5ed3c7dfb8f47d962d9c044dba903b0b4a26f/turtle-0.0.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-c6dr99ga/turtle/setup.py", line 40
except ValueError, ve:
^
SyntaxError: invalid syntax
我尝试下载的文件似乎存在语法错误。有什么办法可以解决吗?
【问题讨论】:
-
显然该脚本是为 Python 2 编写的,而您正尝试在 Python 3 中使用它。在 Python 3 中它将是
except ValueError as ve:。