由于环境错误,pip install pandas 失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/54124820/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 06:16:07  来源:igfitidea点击:

pip install pandas failed because of environment error

pythonpandaspip

提问by HymanU

Trying to install pandas however I get getting the same error:

尝试安装Pandas,但是我得到了同样的错误:

Collecting pandas

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /packages/26/fc/d0509d445d2724fbc5f9c9a6fc9ce7da794873469739b6c94afc166ac2a2/pandas-0.23.4-cp37-cp37m-win32.whl Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /packages/26/fc/d0509d445d2724fbc5f9c9a6fc9ce7da794873469739b6c94afc166ac2a2/pandas-0.23.4-cp37-cp37m-win32.whl Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /packages/26/fc/d0509d445d2724fbc5f9c9a6fc9ce7da794873469739b6c94afc166ac2a2/pandas-0.23.4-cp37-cp37m-win32.whl Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /packages/26/fc/d0509d445d2724fbc5f9c9a6fc9ce7da794873469739b6c94afc166ac2a2/pandas-0.23.4-cp37-cp37m-win32.whl Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /packages/26/fc/d0509d445d2724fbc5f9c9a6fc9ce7da794873469739b6c94afc166ac2a2/pandas-0.23.4-cp37-cp37m-win32.whl Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/26/fc/d0509d445d2724fbc5f9c9a6fc9ce7da794873469739b6c94afc166ac2a2/pandas-0.23.4-cp37-cp37m-win32.whl (Caused by ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)"))

收集大Pandas

pythonhosted.org', port=443):读取超时。(读取超时 = 15)”)':/packages/26/fc/d0509d445d2724fbc5f9c9a6fc9ce7da794873469739b6c94afc166ac2a2/pandas-0.23.4-cp37-cp237mhcp37-0.23.4-cp37-cp237m37-cp37-cp37-cp37-cp237m37-cp37-cp237m37-cp37-cp237m3737-cp37-cp237mh 安装环境可能发生错误。 org', port=443): 最大重试次数超过 url: /packages/26/fc/d0509d445d2724fbc5f9c9a6fc9ce7da794873469739b6c94afc166ac2a2/pandas-0.273344afc166ac2a2/pandas-0.27334.0.26/pandas-0.27334.0.27334.0.2734344afc166ac2a2/pandas-0.27334.0.27334.0.27343434500000000000000000000000000000 .org', port=443): 读取超时。(读取超时=15)"))

I am running command prompt in admin and I am typing in pip install pandas. I have pip version 18.1. I have also tried running this in the windows powershell within the scripts directory for python.

我在管理员中运行命令提示符,我正在输入pip install pandas. 我有 pip 版本 18.1。我还尝试在 python 的脚本目录中的 windows powershell 中运行它。

I have never had an issue installing a package before.

我以前从未遇到过安装软件包的问题。

What is the error caused by and how do I fix it?

错误是由什么引起的,我该如何解决?

Thank you in advance

先感谢您

回答by EcSync

Looks like you're trying to install on a corporate network with a firewall in place, can you connect to another WiFi or hot spot and try downloading again?

看起来您正在尝试在有防火墙的公司网络上安装,您可以连接到另一个 WiFi 或热点并再次尝试下载吗?

回答by Lukasz Korbasiewicz

It seems that you have slow connection to the server. Try increasing the timeout:

您与服务器的连接似乎很慢。尝试增加超时:

sudo pip install --default-timeout=120 pandas

Alternatively, you may use:

或者,您可以使用:

export PIP_DEFAULT_TIMEOUT=120

This is the amount of time (in seconds) pip will wait before deciding that the connection timed out (now it's 15 seconds in your case - "read timeout=15")

这是 pip 在决定连接超时之前将等待的时间(以秒为单位)(现在在您的情况下为 15 秒 - “读取超时 = 15”)

回答by Nishant Mor

If you are logged as Administrator user and still facing this issue. There could be three reasons:

如果您以管理员用户身份登录并且仍然面临此问题。可能有以下三个原因:

  1. Your machine/company's firewall is not allowing you to install/upgrade any module. (Contact support department).
  2. The WiFi is slow. (Fix is mentioned by other users).
  3. Sounds silly but most common reason, you have not rebooted the machine after installing Python on the guest.(Try rebooting).
  1. 您的机器/公司的防火墙不允许您安装/升级任何模块。(联系支持部门)。
  2. WiFi速度很慢。(其他用户提到了修复)。
  3. 听起来很傻,但最常见的原因是,您在来宾上安装 Python 后还没有重新启动机器。(尝试重新启动)。

Let me know if it helped you or anyone reading this comment.

如果它对您或阅读此评论的任何人有帮助,请告诉我。