2017-07-07 66 views
1

蟒蛇PIP工作不落后代理PIP不工作 - 代理

我试图

sudo -H pip --proxy https://proxy_ip:proxy_port install <package> 

sudo -H pip --proxy https://usename:[email protected]_ip:proxy_port install <package> 

sudo easy_install pip 

,并没有什么工作,我也尝试设置环境变量HTTP_PROXY,但它无法正常工作。

Collecting toolz 
    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/toolz/ 
    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/toolz/ 
    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/toolz/ 
    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/toolz/ 
    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/toolz/ 
    Could not find a version that satisfies the requirement toolz (from versions:) 
No matching distribution found for toolz 
+0

可能是你可以参考this post加入--proxy。 –

回答

2

我使用PIP后面代理安装频繁:

例如,尝试安装图尔茨的时候,这里是错误。以下是适用于我的语法:

sudo pip --proxy username:[email protected]_address:port install <package_name> 
1

问题出在加载旧代理设置的conf文件中。此外,环境变量区分大小写。所以,检查是否有在Linux的

使用printenv然后作为@MedAli建议http_proxy和HTTP_PROXY之间的差异:在使用pip将工作