近期发现pip2在升级某些模块的时候会发生一些语法错误,基础pip基础版本是8.1.2
[root@controller ~]# pip --version
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
报错如下:
[root@controller ~]# pip install -U setuptools
Collecting setuptools
Downloading https://files.pythonhosted.org/packages/db/e2/c0ced9ccffb61432305665c22842ea120c0f649eec47ecf2a45c596707c4/setuptools-57.4.0.tar.gz (2.1MB)
100% |████████████████████████████████| 2.2MB 409kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "setuptools/__init__.py", line 16, in <module>
import setuptools.version
File "setuptools/version.py", line 1, in <module>
import pkg_resources
File "pkg_resources/__init__.py", line 1367
**raise SyntaxError(e) from e**
^