Python包未通过pip安装



我在重新安装python后尝试安装软件包,但这些消息显示为

ERROR: Command errored out with exit status 1:
command: 'c:usersljhubappdatalocalprogramspythonpython39python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\ljhub\AppData\Local\Temp\pip-install-aouxvzul\turtle\setup.py'"'"'; __file__='"'"'C:\Users\ljhub\AppData\Local\Temp\pip-install-aouxvzul\turtle\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:UsersljhubAppDataLocalTemppip-pip-egg-info-ov8hdhie'
cwd: C:UsersljhubAppDataLocalTemppip-install-aouxvzulturtle
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:UsersljhubAppDataLocalTemppip-install-aouxvzulturtlesetup.py", line 40
except ValueError, ve:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

我可以安装cython和pypi,但没有其他与pip

您似乎在使用python3,但安装了一个仅支持python2的包。

14:11:09 $ python2 -c 'try: pass
> except Exception, e: pass'
14:11:20 $ python3 -c 'try: pass
except Exception, e: pass'
File "<string>", line 2
except Exception, e: pass
^
SyntaxError: invalid syntax

Python 2已经过时了,所以如果可能的话,你应该寻找一种现代的方法。如果这是不可行的,您仍然可以尝试使用Python 2运行应用程序,但工具链(如pip本身(在该环境中可能无法工作更长时间。


澄清

从这个问题的细节中,我们唯一可以确定的是turtlesetup.py中有一些特定于python2的代码。但很可能应用程序本身不支持python3。

最新更新