0

I am using Python 3.8.1 on Windows and I have pip 19.2.3 from c:\python381\lib\site-packages\pip (python 3.8).

In cmd when I enter 'pip install django' I get:

 WARNING: 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'))': /simple/django/

I looked into the proxy error and tried to fix it using:

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

I'm using the username and password that I use to log into the system. I'm using a port number which i found in the LAN settings under 'Proxy server'. I am supposed to update proxy address as well? This is greyed out.

I get the same error message when running the above. Does anyone know how to fix this?

Mrmoleje
  • 453
  • 1
  • 12
  • 35
  • username&password for the proxy server may be different from the username&password that I use to log into the system. – Philippe Jan 02 '20 at 16:49

2 Answers2

0

Try this :

Open CMD as administrator and export proxy settings

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

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

Then install your package

  • I can’t open cmd as an admin - so it sounds like I need someone with admin access to do this? – Mrmoleje Jan 02 '20 at 17:03
  • Also I’m not sure what you mean by export proxy settings. Do I just run the code you’ve pasted? Or amend it with my user name and password? Thanks – Mrmoleje Jan 02 '20 at 17:04
  • right click the start button (windows logo on the bottom left corner of the screen) and then you'll see a option "Windows PowerShell (Admin)" click that to run cmd as admin. Then paste `pip install --proxy http://user:password@proxyserver:port django` and `pip install --proxy https://user:password@proxyserver:port django` and see which one works – Redwan Hossain Arnob Jan 03 '20 at 10:53
  • If your still getting the same error then try these [link](https://stackoverflow.com/questions/46466241/pip-install-failing-with-407-proxy-authentication-required) and [link](https://stackoverflow.com/questions/19080352/how-to-get-pip-to-work-behind-a-proxy-server) hope this helps – Redwan Hossain Arnob Jan 03 '20 at 11:05
  • I don't have admin access to powershell - I have found a fix, posted – Mrmoleje Jan 03 '20 at 15:11
0

As I do not have access to admin in powershell I'll post an update of how I fixed this proxy issue here:

  • go to the control centre
  • type env in the search box
  • select 'edit environment variables'
  • under http_proxy and https_proxy I updated my password by selecting the relevant line and clicking edit

Once I followed those steps I was able to import packages using pip install on the command line

Mrmoleje
  • 453
  • 1
  • 12
  • 35