pip更新超时失败之解法

风流意气都作罢 提交于 2020-01-31 13:07:21

python卡在pip安装包上了,我用的是pycharm,在它的交互命令行里使用

python -m pip install --upgrade pip
始终报错!
Traceback (most recent call last):
  File "d:\soft\python3.7\lib\site-packages\pip\_vendor\urllib3\response.py", line 331, in _error_catcher
    yield
  File "d:\soft\python3.7\lib\site-packages\pip\_vendor\urllib3\response.py", line 413, in read
    data = self._fp.read(amt)
  File "d:\soft\python3.7\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
    data = self.__fp.read(amt)
  File "d:\soft\python3.7\lib\http\client.py", line 447, in read
    n = self.readinto(b)
  File "d:\soft\python3.7\lib\http\client.py", line 491, in readinto
    n = self.fp.readinto(b)
  File "d:\soft\python3.7\lib\socket.py", line 589, in readinto
    return self._sock.recv_into(b)
  File "d:\soft\python3.7\lib\ssl.py", line 1052, in recv_into
    return self.read(nbytes, buffer)
  File "d:\soft\python3.7\lib\ssl.py", line 911, in read
    return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

从错误上分析显然是下载超时了,那么怎么解决呢?肯定去找国内的镜像资源啊!于是我网上搜索了一番,终于找到了一个好用的:

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

在这里插入图片描述
————————————————
原文链接:https://blog.csdn.net/xqnode/article/details/88431139

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!