python-3.x之安装“模式”时命令 "python setup.py egg_info"失败,错误代码为 1

pengyingh 阅读:27 2024-12-31 21:38:35 评论:0

我正在尝试使用命令提示符在 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
声明

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

关注我们

一个IT知识分享的公众号