Python pip:无法安装matplotlib(ConnectTimeoutError)

swvgeqrz  于 12个月前  发布在  Python
关注(0)|答案(5)|浏览(122)

运行以下命令:

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
omvjsjqw

omvjsjqw1#

检查您的Internet连接。
看起来你无法访问互联网。不太可能,PyPi遇到了暂时的问题,你应该稍后再尝试连接。

ivqmmu1c

ivqmmu1c2#

非常简单的方法一步一步:-
1.从http://www.lfd.uci.edu/~gohlke/pythonlibs/下载matplotlib(.whl)

  1. matplotlib还需要numpydateutilpytzpyparsingcyclersetuptools
    process:open> python 27>>复制并粘贴matplotlib.whlfile
    1.打开cmd on python 27> pip install matplotlib-1.5.1-cp27-none win_amd64.whl
    我认为这是最简单的安装方法。只要尝试它,如果你再次面临同样的问题,然后平我。
anauzrmj

anauzrmj3#

另一个可能的解决方案-我发现一个可执行的安装程序here
以前没在Google上找到。

guykilcj

guykilcj4#

尝试忽略该高速缓存:
pip install matplotlib --no-cache
不知道这是如何工作的,因为当它说ConnectionTimeoutError时,我假设它没有使用该高速缓存。

oyjwcjzk

oyjwcjzk5#

即使这个案件已经解决了我有我的亲笔记本电脑,因为防火墙限制我同样的问题.答案并没有帮助我,所以我张贴的方式,我成功的人,可能在相同的情况比我.
你只需要在本地下载这个包(我把seaborn作为一个文件夹):https://pypi.org/seaborn/,然后点击“下载文件”,然后下载package.tar.gz扩展名。一旦完成,用外部工具解压缩它(对我来说是7-Zip文件管理器),你应该最终得到多个文件夹,如.github,ci,doc,licenses,seaborn等。
现在你所要做的就是剪切并粘贴python\Lib\site-packages中以你想要的包命名的文件夹(对我来说是seaborn),它应该在这样的位置:C:\Program Files\Python310\Lib\site-packages
附言:我不确定这样做是否能让你访问包的所有功能,但它现在对我来说工作正常。所以不要犹豫,告诉我这样做是否是一个好主意。

相关问题