Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python - Pip Install - Proxy Error - 'Cannot connect to proxy.', OSError'

I want to install some modules in a Enterprise VM in order to create some Python Scripts. I'm trying to use PIP with Proxy to do it. I'm using this command lines:

C:\Users\user>SET HTTPS_PROXY=https://user:[email protected]:8080

C:\Users\user>SET PROXY=http://user:[email protected]:8080

C:\Users\user>pip install datetime

To have access to my virtual machine I've this credentials:

  • USER: NAN/user
  • PASS: pass

But I am getting this error:

Collecting datetime
  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: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )',))': /simple/datetime/
  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: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )',))': /simple/datetime/
  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: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )',))': /simple/datetime/
  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: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )',))': /simple/datetime/
  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: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )',))': /simple/datetime/
  Could not find a version that satisfies the requirement datetime (from versions: )
No matching distribution found for datetime

What I need to do in order to get the python module?

like image 633
SaCvP Avatar asked Dec 24 '22 07:12

SaCvP


1 Answers

In my case, it was only because the 【VPN】 software modified the 【System Proxy】 configuration of the 【IE】 browser.

I modified it back in this way:

  1. open 【IE】
  2. Press 【Alt+X】 and scroll down to 【Internet options】
  3. Click on the 【Connections】 tab
  4. Press the 【LAN settings】 button
  5. Uncheck the 【Proxy Server】

This is how my problem was successfully solved.

like image 196
Lancer.Yan Avatar answered Dec 31 '22 14:12

Lancer.Yan