pip安装依赖失败

发布时间 2023-11-03 16:30:39作者: DogLeftover
  • 报错如下
Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4)
Collecting pip
  Downloading pip-23.3.1-py3-none-any.whl (2.1 MB)
     --- ------------------------------------ 0.2/2.1 MB 6.6 kB/s eta 0:04:49
ERROR: Exception:
Traceback (most recent call last):
  File "C:\Users\ychen\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\urllib3\response.py", line 438, in _error_catcher
// ......
ERROR: Operation cancelled by user
WARNING: You are using pip version 22.0.4; however, version 23.3.1 is available.
You should consider upgrading via the 'C:\Users\ychen\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command.
  • 更换源
豆瓣:http://pypi.douban.com/simple/
中科大:https://pypi.mirrors.ustc.edu.cn/simple/
清华:https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云:https://mirrors.aliyun.com/pypi/simple/

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
  • 查看pip的版本
pip list

# 升级
python -m pip install --upgrade pip