pip安装失败,需要407 Proxy Authentication

Man*_*asu 9 authentication proxy pip rhel tunnel

我正在尝试使用下面的pip install命令,但它失败了代理身份验证需要问题.我已经在RHEL7.x服务器中配置了代理.

Command Used: `pip install --proxy https://'username:pwd'@proxy:host  --upgrade pip`
Run Code Online (Sandbox Code Playgroud)

日志:

Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/pip/
Run Code Online (Sandbox Code Playgroud)

Nit*_*Pal 9

这是您应该尝试的第一件事:

打开命令提示符(CMD)。

导出代理设置:

:\set http_proxy=http://username:password@proxyAddress:port

:\set https_proxy=https://username:password@proxyAddress:port

安装要安装的软件包:

:\pip install PackageName


bas*_*flp 5

错误407意味着代理的身份验证丢失/错误。'username:pwd零件上取下,即使用:pip install --proxy https://username:pwd@proxy:host

作为另一种选择,在安装 Python 包之前尝试从该服务器打开 Internet 连接。

如果这没有帮助,请尝试此处此处此处问题的答案中给出的选项。

  • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接答案可能会失效。- [来自评论](/review/low-quality-posts/17884246) (3认同)
  • 不,您需要在密码中编码特殊字符。请按照以下步骤操作.. 1) 打开 Chrome 开发工具并转到控制台.. 2) 输入 encodeURIComponent('domain\\<username>:<password>') 3) 它将返回编码字符串.. 只需复制粘贴即可。@奥沙达 (3认同)