我正在尝试使用命令提示符在 python 3.6 上安装模式:
pip3 install pattern
但是我收到这个错误:
C:\WINDOWS\system32>pip3 install pattern
Collecting pattern
Using cached pattern-2.6.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\HP\AppData\Local\Temp\pip-build-u_5lhmfa\pattern\setup.py", line 40
print n
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(int n)?
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\HP\AppData\Local\Temp\pip-build-u_5lhmfa\pattern\
顺便说一句,我也安装了 Python 2.7,当我使用 pip2 install pattern
安装时,它完美安装。
问题出在 python 3.6 上。我该如何解决这个问题?
最佳答案
Pattern-2.6 at PyPI似乎很旧(最后更新于 2014 年)。他们 require Python 2.5+。我认为该代码仅适用于 Python2,您不能将其与 Python 3 一起使用。
Pattern3似乎是 Python 3 的包:
pip install pattern3
关于python-3.x - 安装“模式”时命令 "python setup.py egg_info"失败,错误代码为 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48037154/