【问题标题】:How to fix "Could not install packages due to an EnvironmentError: HTTPSConnectionPool" error?如何修复“由于 EnvironmentError:HTTPSConnectionPool 无法安装软件包”错误?
【发布时间】:2019-09-05 09:17:14
【问题描述】:

我正在尝试安装 jupyterthemes 包并收到此错误。

Collecting jupyterthemes
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /packages/8a/08/9dee6dfd7f2aad6c30282d55c8f495b4dc1e4747b4e2bdbeb80572ddf312/jupyterthemes-0.20.0-py2.py3-none-any.whl
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /packages/8a/08/9dee6dfd7f2aad6c30282d55c8f495b4dc1e4747b4e2bdbeb80572ddf312/jupyterthemes-0.20.0-py2.py3-none-any.whl
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /packages/8a/08/9dee6dfd7f2aad6c30282d55c8f495b4dc1e4747b4e2bdbeb80572ddf312/jupyterthemes-0.20.0-py2.py3-none-any.whl
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /packages/8a/08/9dee6dfd7f2aad6c30282d55c8f495b4dc1e4747b4e2bdbeb80572ddf312/jupyterthemes-0.20.0-py2.py3-none-any.whl
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /packages/8a/08/9dee6dfd7f2aad6c30282d55c8f495b4dc1e4747b4e2bdbeb80572ddf312/jupyterthemes-0.20.0-py2.py3-none-any.whl
Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/8a/08/9dee6dfd7f2aad6c30282d55c8f495b4dc1e4747b4e2bdbeb80572ddf312/jupyterthemes-0.20.0-py2.py3-none-any.whl (Caused by ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)))

【问题讨论】:

  • 你似乎在代理后面运行 pip,如果是这样运行pip --proxy "put proxy here" install jupyterthemes

标签: python python-3.x pip


【解决方案1】:

您似乎需要添加受信任的主机。

检查this GitHub线程。

类似:

sudo pip install --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org --upgrade --proxy=127.0.0.1:3128 jupyterthemes

【讨论】:

    【解决方案2】:

    请检查日期是否设置正确。通常当时间和日期与服务器的不同时会弹出此错误。

    【讨论】:

      【解决方案3】:

      尝试设置代理

      set http_proxy=http://proxy.myproxy.com
      set https_proxy=https://proxy.myproxy.com
      python get-pip.py
      

      【讨论】:

        【解决方案4】:

        我认为有些软件包需要使用管理员权限安装 在 mac 上试试这个:

        sudo pip install

        在窗口上:

        您必须以管理员身份运行 cmd。 我的意思是右键单击cmd,选择

        以管理员身份运行 然后 pip install pkg 名称

        【讨论】:

          【解决方案5】:

          对我来说,这是由于网络防火墙设置造成的,请尝试连接到任何其他网络并运行命令。它对我有用。

          【讨论】:

            猜你喜欢
            • 2021-09-06
            • 2020-05-16
            • 2017-09-18
            • 1970-01-01
            • 2021-08-09
            • 2021-09-09
            • 2021-02-09
            • 2020-08-03
            • 2019-02-27
            相关资源
            最近更新 更多