window下pip按住安装Django出现错误提示 socket.timeout: The read operation timed out

执行 pip install Django命令出现如下错误提示:

Traceback (most recent call last):
  File "d:\learning_blog\ll_env\lib\site-packages\pip\_vendor\urllib3\response.py", line 360, in _error_catcher
    yield
  File "d:\learning_blog\ll_env\lib\site-packages\pip\_vendor\urllib3\response.py", line 442, in read
    data = self._fp.read(amt)
  File "d:\learning_blog\ll_env\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
    data = self.__fp.read(amt)
  File "D:\Python\Python37\lib\http\client.py", line 447, in read
    n = self.readinto(b)
  File "D:\Python\Python37\lib\http\client.py", line 491, in readinto
    n = self.fp.readinto(b)
  File "D:\Python\Python37\lib\socket.py", line 589, in readinto
    return self._sock.recv_into(b)
  File "D:\Python\Python37\lib\ssl.py", line 1052, in recv_into
    return self.read(nbytes, buffer)
  File "D:\Python\Python37\lib\ssl.py", line 911, in read
    return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

由于网络原因导致 -----------

更改命令为:pip --default-timeout=100 install -U Django 

增加网络判断时间即成功:

Collecting Django
  Downloading https://files.pythonhosted.org/packages/b1/1d/2476110614367adfb079a9bc718621f9fc8351e9214e1750cae1832d4090/Django-2.2.1-py3-none-any.whl (7.4MB)
     |████████████████████████████████| 7.5MB 595kB/s
Collecting sqlparse (from Django)
  Downloading https://files.pythonhosted.org/packages/ef/53/900f7d2a54557c6a37886585a91336520e5539e3ae2423ff1102daf4f3a7/sqlparse-0.3.0-py2.py3-none-any.whl
Collecting pytz (from Django)
  Downloading https://files.pythonhosted.org/packages/3d/73/fe30c2daaaa0713420d0382b16fbb761409f532c56bdcc514bf7b6262bb6/pytz-2019.1-py2.py3-none-any.whl (510kB)
     |████████████████████████████████| 512kB 819kB/s
Installing collected packages: sqlparse, pytz, Django
Successfully installed Django-2.2.1 pytz-2019.1 sqlparse-0.3.0

python入门记录。

 

你可能感兴趣的:(window下pip按住安装Django出现错误提示 socket.timeout: The read operation timed out)