【问题标题】:Unable to install Numpy Getting Could not install packages due to an EnvironmentError: HTTPSConnectionPoolUnable to install Numpy Getting 由于 EnvironmentError: HTTPSConnectionPool 无法安装包
【发布时间】:2020-09-03 05:07:54
【问题描述】:

无法使用命令提示符在 Windows 10 系统中安装 numpy。我之前安装了相同的,但这次出现以下错误。提前感谢您的帮助。

C:\Users\MyPC>pip install numpy
Collecting numpy
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x0498B778>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /packages/52/2c/bf86d762ae65550dc8a7ab8381ba610bb69af6db619b3755f2b73052c6b9/numpy-1.18.4-cp38-cp38-win32.whl
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x049AA6B8>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /packages/52/2c/bf86d762ae65550dc8a7ab8381ba610bb69af6db619b3755f2b73052c6b9/numpy-1.18.4-cp38-cp38-win32.whl
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04A3F028>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /packages/52/2c/bf86d762ae65550dc8a7ab8381ba610bb69af6db619b3755f2b73052c6b9/numpy-1.18.4-cp38-cp38-win32.whl
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04A3F100>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /packages/52/2c/bf86d762ae65550dc8a7ab8381ba610bb69af6db619b3755f2b73052c6b9/numpy-1.18.4-cp38-cp38-win32.whl
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04A3F1D8>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /packages/52/2c/bf86d762ae65550dc8a7ab8381ba610bb69af6db619b3755f2b73052c6b9/numpy-1.18.4-cp38-cp38-win32.whl
ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/52/2c/bf86d762ae65550dc8a7ab8381ba610bb69af6db619b3755f2b73052c6b9/numpy-1.18.4-cp38-cp38-win32.whl (Caused by NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x04A3F2B0>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed'))

【问题讨论】:

    标签: python numpy pycharm window


    【解决方案1】:

    这个问题是在 PIP 的 GitHub 问题上提出的:https://github.com/pypa/pip/issues/5448

    添加--trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org 可能会解决问题。

    【讨论】:

    • 感谢您的回复,但仍然出现同样的错误。 C:\Users\MyPC>pip install numpy --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org
    【解决方案2】:

    当我从第一次使用的旧网络安装 numpy 时,它安装成功。

    【讨论】:

    • 这对我们来说是一个非常糟糕的解决方案,因为我们不知道您的旧网络是什么。为什么它能解决问题?
    • 没错,这就是为什么需要一个适当的解决方案。
    猜你喜欢
    • 2019-06-07
    • 2022-12-27
    • 2019-02-27
    • 2020-09-22
    • 1970-01-01
    • 2019-03-27
    • 2019-01-08
    • 2021-08-09
    • 2023-04-03
    相关资源
    最近更新 更多