2017-07-07 65 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將工作