概述
升级pip后,出现异常,导致无法进行任何的pip相关的操作。网上找了很多教程,都无效,后来经过反复摸索,问题解决了。
尝试方案1:
Python中更新pip失败导致损坏的修复_老鱼干的博客-CSDN博客_python3修复pip
运行提示没有pip模块
PS C:Users86176> pip install --upgrade pip
Traceback (most recent call last):
File "d:program filespython38librunpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "d:program filespython38librunpy.py", line 87, in _run_code
exec(code, run_globals)
File "D:Program FilesPython38Scriptspip.exe__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'
解决办法
执行python -m ensurepip,python -m pip install --upgrade pip即可
PS C:Users86176> python -m ensurepip
Looking in links: c:Users86176AppDataLocalTemptmpjplwmax8
Requirement already satisfied: setuptools in d:program filespython38libsite-packages (49.2.1)
Processing c:users86176appdatalocaltemptmpjplwmax8pip-20.2.1-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-20.2.1
PS C:Users86176>
PS C:Users86176> python -m pip install --upgrade pip
Looking in indexes: https://pypi.douban.com/simple
Collecting pip
Using cached https://pypi.doubanio.com/packages/7c/02/9ab8b431aca1b46fcc1ac830a5870a28a12ba1abfa681904b1d2da876a86/pip-21.2.1-py3-none-any.whl (1.6 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.1
Uninstalling pip-20.2.1:
Successfully uninstalled pip-20.2.1
Successfully installed pip-21.2.1
测试
PS C:Users86176> pip list
方案1验证无效
方案2
找到之前安装OK的版本,进入 D:PythonLibsite-packages 路径,找到pip和pip-22.1.2.dist-info目录,将其复制到对应的路径下,问题解决。
最后
以上就是稳重诺言为你收集整理的关于pip升级损坏导致的问题记录的全部内容,希望文章能够帮你解决关于pip升级损坏导致的问题记录所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复