我正在尝试从 pyCharm IDE 的内部终端安装“预处理”包,但它显示以下错误。
我尝试了这个命令
pip install preprocess
我收到以下错误
Collecting preprocess
Using cached
https://files.pythonhosted.org/packages/05/f9/559841df6c91428a2024ce120d92 192844178e4b2ceec1da84ce18205380/pr
eprocess-1.1.0.zip
ERROR: Command errored out with exit status 1:
command: 'c:\users\majid\appdata\local\programs\python\python38- 32\python.exe' -c 'import sys, setuptools, tokenize; sy
s.argv[0] = '"'"'C:\\Users\\majid\\AppData\\Local\\Temp\\pip- install-rsxg10hs\\preprocess\\setup.py'"'"'; __file__='"'"'C:\\
Users\\majid\\AppData\\Local\\Temp\\pip-install- rsxg10hs\\preprocess\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open
)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg
_info --egg-base 'C:\Users\majid\AppData\Local\Temp\pip-install- rsxg10hs\preprocess\pip-egg-info'
cwd: C:\Users\majid\AppData\Local\Temp\pip-install- rsxg10hs\preprocess\
Complete output (8 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\majid\AppData\Local\Temp\pip-install-rsxg10hs\preprocess\setup.py", line 28, in <module>
import preprocess
File "C:\Users\majid\AppData\Local\Temp\pip-install-rsxg10hs\preprocess\lib\preprocess.py", line 264
except Exception, ex:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
最佳答案
作为release history of the project preprocess
表明,这是一个非常古老的项目,已有 10 多年没有发布过。它不太可能与当前版本的 Python 兼容。问题中的错误输出似乎显示错误消息来自尝试安装 Python 3.8 的项目,并且错误本身似乎表明它在使用 Python 2 语法的代码上失败。
我根本不建议使用这个项目。或者,您可以尝试将其与 Python 2 版本的解释器一起使用。
关于python - 使用 pip 命令安装软件包 'preprocess' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59100348/