靳闯博客 记录是一种习惯 、分享是一种态度
  • 波浪
  • 波浪
  • 波浪
  • 波浪
pip 安装错误 Command "python setup.py egg_info" failed with error code
发表于: | 分类: 技术积累 | 标签: Python Centos7 pip

[python2.7版本] pip安装包 或者 pip升级pip版本出现此错误:

······
      File "/tmp/pip-build-vD3Ntt/pip/setup.py", line 7
        def read(rel_path: str) -> str:
                         ^
    SyntaxError: invalid syntax
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-vD3Ntt/pip/
You are using pip version 8.1.2, however version 21.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

出现此错误后,执行升级pip和setuptools也出同样错误,网上搜索此错误解决方式都是升级pip和setuptools

pip.png


原因呢肯定是pip问题了,解决办法:

wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
python get-pip.py
pip install --upgrade setuptools

商业转载请联系作者获得授权,非商业转载请注明出处 本文地址:https://me.jinchuang.org/archives/1158.html

如果这篇文章帮助到了你,我感到十分荣幸!


📬 评论留言 ↴

TOP