当前位置:首页 >> 脚本专栏

解决python -m pip install --upgrade pip 升级不成功问题

据小编统计绝大多数朋友对这一问题很棘手,今天小编给大家分享这一问题的解决方案,一起看看吧

使用pip 提示更新:

You are using pip version 18.1, however version 20.0.2 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

输入python -m pip install --upgrade pip出现问题


解决python -m pip install --upgrade pip 升级不成功问题

这是因为服务器连接超时,使用下方代码即可解决(因为pip源在国外,所以连起来比较慢,可以改用国内的源)

python -m pip install --upgrade pip -i https://pypi.douban.com/simple

解决python -m pip install --upgrade pip 升级不成功问题
解决python -m pip install --upgrade pip 升级不成功问题

问题解决

安装其他包也可使用此方法加快下载速度
比如 安装pip install scipy

pip install scipy -i https://pypi.douban.com/simple

安装

C:\WINDOWS\system32>pip install scipy -i https://pypi.douban.com/simple
Looking in indexes: https://pypi.douban.com/simple
Collecting scipy
 Downloading https://pypi.doubanio.com/packages/61/51/046cbc61c7607e5ecead6ff1a9453fba5e7e47a5ea8d608cc7036586a5ef/scipy-1.4.1-cp37-cp37m-win_amd64.whl (30.9 MB)
  |████████████████████████████████| 30.9 MB 6.8 MB/s
Collecting numpy>=1.13.3
 Downloading https://pypi.doubanio.com/packages/a9/38/f6d6d8635d496d6b4ed5d8ca4b9f193d0edc59999c3a63779cbc38aa650f/numpy-1.18.1-cp37-cp37m-win_amd64.whl (12.8 MB)
  |████████████████████████████████| 12.8 MB 6.4 MB/s
Installing collected packages: numpy, scipy
Successfully installed numpy-1.18.1 scipy-1.4.1

C:\WINDOWS\system32>

 总结