简体   繁体   English

Python pip:无法安装matplotlib(ConnectTimeoutError)

[英]Python pip: Can't install matplotlib (ConnectTimeoutError)

Running the following command: 运行以下命令:

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

Gives the following output: 提供以下输出:

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

Check your Internet connection. 检查您的Internet连接。

It seems that the Internet is unreachable for you. 您似乎无法访问Internet。 Less likely, PyPi is experiencing temporary problems and you should try connecting later. PyPi出现暂时性问题的可能性较小,您应该稍后再尝试连接。

Very simple methods step by step:- 逐步的非常简单的方法:-

  1. Download matplotlib(.whl) from http://www.lfd.uci.edu/~gohlke/pythonlibs/ http://www.lfd.uci.edu/~gohlke/pythonlibs/下载matplotlib(.whl)

  2. matplotlib also Requires numpy , dateutil , pytz , pyparsing , cycler , setuptools matplotlib还需要numpydateutilpytzpyparsingcyclersetuptools

    process: open>python27>>Scripts>copy and paste matplotlib.whlfile 过程:打开> python27 >>脚本>复制并粘贴matplotlib.whlfile

  3. open cmd on python27>Scripts> pip install matplotlib-1.5.1-cp27-none win_amd64.whl 在python27>脚本> pip install matplotlib-1.5.1-cp27-none win_amd64.whl上打开cmd

I think this is the simplest install method. 我认为这是最简单的安装方法。 Just try it if you face again same problem then ping me. 如果您再次遇到相同的问题,请尝试一下,然后ping通我。

Another possible solution - I found an executable installer here 另一个可能的解决方案-我在这里找到了可执行安装程序

Didn't find it with Google before. 以前没有在Google找到它。

Try ignoring the cache: 尝试忽略缓存:

pip install matplotlib --no-cache

No idea how this works, because when it said ConnectionTimeoutError , I assumed that it was not using the cache. 不知道它是如何工作的,因为当它说ConnectionTimeoutError ,我以为它没有使用缓存。 If this works for anyone, I'd love to hear an explanation. 如果这对任何人都有效,我希望听到一个解释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM