python安装numpy和matplotlib异常(使用pip)

时间:2017-08-06 14:38:07

标签: python numpy matplotlib pip

我在安装numpy和matplotlib时遇到以下错误。我不知道如何解决它。

    D:\Program Files (x86)\Python\Python36-32>pip install matplotlib
Collecting matplotlib
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out. (read timeout=15)",)': /simple/matplotlib/
  Downloading matplotlib-2.0.2-cp36-cp36m-win32.whl (8.7MB)
    14% |████▌                           | 1.2MB 33kB/s eta 0:03:46Exception:
Traceback (most recent call last):
  File "d:\program files (x86)\python\python36-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 232, in _error_catcher
    yield
  File "d:\program files (x86)\python\python36-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 314, in read
    data = self._fp.read(amt)
  File "d:\program files (x86)\python\python36-32\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 60, in read
    data = self.__fp.read(amt)
  File "d:\program files (x86)\python\python36-32\lib\http\client.py", line 449, in read
    n = self.readinto(b)
  File "d:\program files (x86)\python\python36-32\lib\http\client.py", line 493, in readinto
    n = self.fp.readinto(b)
  File "d:\program files (x86)\python\python36-32\lib\socket.py", line 586, in readinto
    return self._sock.recv_into(b)
  File "d:\program files (x86)\python\python36-32\lib\ssl.py", line 1002, in recv_into
    return self.read(nbytes, buffer)
  File "d:\program files (x86)\python\python36-32\lib\ssl.py", line 865, in read
    return self._sslobj.read(len, buffer)
  File "d:\program files (x86)\python\python36-32\lib\ssl.py", line 625, in read
    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

我是python的新手,我该如何解决? 任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:1)

您的问题似乎是由于您的互联网连接速度很慢造成的。 如果您无法加快速度或更改访问点,则可以下载matplotlib binariesnumpy binaries并使用pip install file.whl离线安装

或者在几分钟内再试一次。