PIP版本过低,更新无用,Command “python setup.py egg_info“ failed with error code 1 in报错

Ubuntu下pip install ****时候python2.7总是报错

Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-Jr__s9/pandas/setup.py", line 250
        f"{extension}-source file '{sourcefile}' not found.\n"
                                                             ^
    SyntaxError: invalid syntax
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Jr__s9/pandas/

网上找了很多解决办法,都是更新执行升级pip和setuptools,但是也出同样错误,升级了最新的版本,但是查看版本号,还是原来的版本

slam@ubuntu:~$ 
slam@ubuntu:~$ python get-pip.py
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Collecting pip<21.0
  Using cached pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
Successfully installed pip-20.3.4
slam@ubuntu:~$ pip -V
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)

解决办法直接卸载自己的pip,重新装

好像是因为版本跨度太大,无法直接升级

按照下面的几步直接解决

//卸载自己的pip 部分有的是卸载python3-pip
sudo apt-get remove python-pip

wget https://bootstrap.pypa.io/pip/2.7/get-pip.py

python get-pip.py

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值