【问题标题】:pip install selenium - 'Tunnel connection failed: 403 Forbidden'pip install selenium - '隧道连接失败:403 Forbidden'
【发布时间】:2019-08-30 18:43:56
【问题描述】:

我正在尝试通过pip 安装selenium,但是它在以下环境错误下失败:

Tunnel connection failed: 403 Forbidden

我已经搜索了解决方案,但我理解的没有一个有效,所以我需要一些帮助

(base) C:\>pip install selenium
Collecting selenium
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /packages/80/d6/4294f0b4bce4de0abf13e17190289f9d0613b0a44e5dd6a7f5ca98459853/selenium-3.141.0-py2.py3-none-any.whl
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /packages/80/d6/4294f0b4bce4de0abf13e17190289f9d0613b0a44e5dd6a7f5ca98459853/selenium-3.141.0-py2.py3-none-any.whl
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /packages/80/d6/4294f0b4bce4de0abf13e17190289f9d0613b0a44e5dd6a7f5ca98459853/selenium-3.141.0-py2.py3-none-any.whl
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /packages/80/d6/4294f0b4bce4de0abf13e17190289f9d0613b0a44e5dd6a7f5ca98459853/selenium-3.141.0-py2.py3-none-any.whl
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden'))': /packages/80/d6/4294f0b4bce4de0abf13e17190289f9d0613b0a44e5dd6a7f5ca98459853/selenium-3.141.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/80/d6/4294f0b4bce4de0abf13e17190289f9d0613b0a44e5dd6a7f5ca98459853/selenium-3.141.0-py2.py3-none-any.whl (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))

【问题讨论】:

  • 你在代理后面吗?你能分享整个回溯
  • 更新为包含

标签: python windows selenium pip installation


【解决方案1】:

您可以尝试以下方法吗:

pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org selenium

如果上面的方法不行,你可以试试下面的方法吗:

  1. here下载selenium
  2. 转到文件夹selenium/py
  3. 运行命令python setup.py install

【讨论】:

  • 恐怕同样的结果
  • 您是否在使用任何其他库时遇到此问题
  • 我安装的其他所有东西都没有问题
  • 嗨 Jeril,看起来该下载中没有文件,getAttribute.js with the Webdriver\remote 文件夹。
猜你喜欢
  • 1970-01-01
  • 2013-12-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多