【问题标题】:How to configure Python with M$ Forefront (TMG) proxy如何使用 M$ Forefront (TMG) 代理配置 Python
【发布时间】:2018-03-19 09:40:34
【问题描述】:

我正在尝试在公司防火墙后面使用 Python 3.7 和 PIP(在 Windows 7 上),但出现以下错误:

Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed:
407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )',))': /simple/pywin32/

我尝试了以下配置来传递代理访问,但其中任何一个都不起作用:(

set HTTP_PROXY=http://DOMAIN\user:pass@proxyhost:port

set HTTP_PROXY=http://user:pass@proxyhost:port

set HTTP_PROXY=http://proxyhost:port

【问题讨论】:

  • 很可能是公司防火墙阻止了 PIP,您无法自行修复(过去曾多次发生在我身上)。您需要获得 pip install 的许可才能安装您想要安装的任何东西。

标签: python windows python-3.x proxy pip


【解决方案1】:

我的组织代理身份验证也有问题,在 Windows 操作系统中出现 407 错误,最后使用 CTNLM 解决了它,所以首先尝试为您的代理配置 ctnlm 并使用您的浏览器对其进行测试(配置位于在 Windows 的 %PROGRAMFILES%\Cntlm\cntlm.ini 中,默认代理应该类似于 http://localhost:3128),如果它有效,请将其提供给 pip install :--proxy http://localhost:3128

【讨论】:

    猜你喜欢
    • 2014-01-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-16
    • 1970-01-01
    • 2012-02-17
    • 2017-08-24
    • 1970-01-01
    相关资源
    最近更新 更多