CentOS 7下,pip install -upgrade pip 导致 pip 无法使用的问题 ImportError: No module named typing
问题现象
pip安装某第三方 SDK,提示升级 pip,按提示升级 pip 后报错
导致报错的 pip 升级命令
pip install --upgrade pip
pip 错误提示
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point('pip==21.1.2', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/lib/python2.7/site-packages/pip/__init__.py", line 1, in <module>
from typing import List, Optional
ImportError: No module named typing