Python pip:无法安装matplotlib(ConnectTimeoutError)

时间:2016-04-12 10:44:04

标签: python python-2.7 matplotlib pip

运行以下命令:

pip install matplotlib --disable-pip-version-check

提供以下输出:

Collecting matplotlib
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip
._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02D9D0F0>, 'Connection to pypi.python.
org timed out. (connect timeout=15)')': /simple/matplotlib/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip
._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02D9DE70>, 'Connection to pypi.python.
org timed out. (connect timeout=15)')': /simple/matplotlib/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip
._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02D9D890>, 'Connection to pypi.python.
org timed out. (connect timeout=15)')': /simple/matplotlib/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip
._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02D9D8D0>, 'Connection to pypi.python.
org timed out. (connect timeout=15)')': /simple/matplotlib/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip
._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02D9DD90>, 'Connection to pypi.python.
org timed out. (connect timeout=15)')': /simple/matplotlib/
  Could not find a version that satisfies the requirement matplotlib (from versions: )
No matching distribution found for matplotlib

4 个答案:

答案 0 :(得分:3)

检查您的互联网连接。

似乎无法访问互联网。不太可能,PyPi遇到了临时问题,您应该稍后尝试连接。

答案 1 :(得分:1)

一步一步的非常简单的方法: -

  1. http://www.lfd.uci.edu/~gohlke/pythonlibs/

  2. 下载matplotlib(.whl)
  3. matplotlib还需要numpydateutilpytzpyparsingcyclersetuptools

    过程: 打开&gt; python27&gt;&gt;脚本&gt;复制并粘贴matplotlib.whlfile

  4. 在python27上打开cmd&gt;脚本&gt; pip install matplotlib-1.5.1-cp27-none win_amd64.whl

  5. 我认为这是最简单的安装方法。 如果再遇到同样的问题,请尝试一下然后ping我。

答案 2 :(得分:0)

另一种可能的解决方案 - 我找到了一个可执行安装程序here

以前没有在Google找到它。

答案 3 :(得分:0)

尝试忽略缓存:

pip install matplotlib --no-cache

不知道它是如何工作的,因为当它说ConnectionTimeoutError时,我以为它没有使用缓存。如果此方法对任何人都有效,我希望听到一个解释。