当前位置:网站首页>关于pip升级损坏导致的问题记录
关于pip升级损坏导致的问题记录
2022-07-29 07:44:00 【幸福的达哥】
升级pip后,出现异常,导致无法进行任何的pip相关的操作。网上找了很多教程,都无效,后来经过反复摸索,问题解决了。
尝试方案1:
Python中更新pip失败导致损坏的修复_老鱼干的博客-CSDN博客_python3修复pip
运行提示没有pip模块
PS C:\Users\86176> pip install --upgrade pip
Traceback (most recent call last):
File "d:\program files\python38\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "d:\program files\python38\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "D:\Program Files\Python38\Scripts\pip.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'
解决办法
执行python -m ensurepip,python -m pip install --upgrade pip即可
PS C:\Users\86176> python -m ensurepip
Looking in links: c:\Users\86176\AppData\Local\Temp\tmpjplwmax8
Requirement already satisfied: setuptools in d:\program files\python38\lib\site-packages (49.2.1)
Processing c:\users\86176\appdata\local\temp\tmpjplwmax8\pip-20.2.1-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-20.2.1
PS C:\Users\86176>
PS C:\Users\86176> 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:\Users\86176> pip list
方案1验证无效
方案2
找到之前安装OK的版本,进入 D:\Python\Lib\site-packages\ 路径,找到pip和pip-22.1.2.dist-info目录,将其复制到对应的路径下,问题解决。
边栏推荐
猜你喜欢

Go, how to become a gopher, and find work related to go language in 7 days, Part 1

【MYSQL】-【子查询】

Use custom annotations to verify the size of the list

QT connects two qslite databases and reports an error qsqlquery:: exec: database not open

技术分享| 快对讲综合调度系统

2022年深圳杯A题破除“尖叫效应”与“回声室效应”走出“信息茧房”
What are the principles and methods of implementing functional automation testing?

NFT 的 10 种实际用途

LANDSCAPE

【深度学习】数据准备-pytorch自定义图像分割类数据集加载
随机推荐
Better performance and simpler lazy loading of intersectionobserverentry (observer)
LANDSCAPE
零数科技深度参与信通院隐私计算金融场景标准制定
FLink CDC 的mysql connector中,mysql的字段是varbinary, 官方
Multi thread shopping
Blue Bridge Cup group a selection XOR
The difference between static library and dynamic library of program
OA项目之会议通知(查询&是否参会&反馈详情)
写点dp
基于高阶无六环的LDPC最小和译码matlab仿真
准备esp32环境
08 dynamic programming
MySQL 45 | 08 is the transaction isolated or not?
Reflect reflect
【暑期每日一题】洛谷 P6408 [COCI2008-2009#3] PET
Pat class a 1150 traveling salesman problem
Prometheus与Grafana
【暑期每日一题】洛谷 P4414 [COCI2006-2007#2] ABC
Write some DP
Chaos and future of domestic digital collections