问题遇到的现象和发生背景
linux环境,在原有pip出现问题、卸载了所有有关pip的文件后准备重装(usr/bin目录下仍然保留着一个pip的链接文件)。
问题相关代码,请勿粘贴截图
直接执行pip命令
运行结果及报错内容
[root@myl-2019213690-0001 ~]# pip
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/python3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3259, in <module>
@_call_aside
File "/usr/local/python3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3234, in _call_aside
f(*args, **kwargs)
File "/usr/local/python3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3272, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/python3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 581, in _build_master
ws.require(__requires__)
File "/usr/local/python3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 909, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/python3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 795, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==7.1.2' distribution was not found and is required by the application
我的解答思路和尝试过的方法
目前重装pip的方式全部失败,只要输入pip就会出现以上错误。
我想要达到的结果
以任何方式修复好以上问题——无论是装好python3和pip3并使得二者协调还是把python3和pip3全部从电脑中清除干净。