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