0

Context:

I am installing the packages from a cloned repo with pip.

What I was doing when I ran into problems:

python3 -m pip install --proxy "http://internal.url:8080" --upgrade pip //Update pip and set proxy server

pip install -r requirements.txt // install packages

Result:

WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001F6DF6CB7C0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')': /simple/azure-mgmt-resource/ ERROR: Could not find a version that satisfies the requirement azure-mgmt-resource (from -r requirements.txt (line 1)) (from versions: none) ERROR: No matching distribution found for azure-mgmt-resource (from -r requirements.txt (line 1))

My System: - Windows 10 - Python 3.8.3rc1 - Pip 20.1

I've updated pip: Some S.O. answers say that the issue is a need to update pip. I've tried this answer, which called for: curl https://bootstrap.pypa.io/get-pip.py | python

The result was:

C:\PythonApps\carrieralloc-poc>curl https://bootstrap.pypa.io/get-pip.py | python
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:55 --:--:--     0curl: (7) Failed to connect to bootstrap.pypa.io port 443: Connection refused

"connection refused" is a theme here.

This blog suggested that perhaps my ip address was blacklisted (doubtful as I'm using a corporate proxy) But I tried his suggestion and ran curl https://pypi.org

The results: curl: (7) Failed to connect to pypi.org port 443: Connection refused

I got to wondering if my proxy is set correctly:

I can't find a command for checking my proxy.

Any pointers? Thank you!

208_man
  • 1,440
  • 3
  • 28
  • 59

2 Answers2

0

You're on windows, right?

I imagine you would get the same if you tried to use powershell to do the same thing.

Try this:

Invoke-WebRequest -URI https://www.google.ca

If the command above is successful, you should expect a HTTP response, otherwise it should error out like the rest of your stuff.

Try running this powershell command to retrieve your proxy address:

[System.Net.Webproxy]::GetDefaultProxy()
moosearch
  • 176
  • 9
  • Thanks @moosearch. The Invoke-WebRequest command returned a 200 response. Worked ok. – 208_man May 08 '20 at 14:04
  • Running the GetDefaultProxy command returned nothing: Address : BypassProxyOnLocal : Fals BypassList : {} Credentials : UseDefaultCredentials : Fals BypassArrayList : {} – 208_man May 08 '20 at 14:05
  • Yes, I'm on windows 10. – 208_man May 08 '20 at 14:05
  • @mike_butak Did you try the invoke-webrequest with pypi? Also, try running the following powershell command ```Get-ItemProperty -Path "Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings"``` to retrieve your proxy server. I think you may have to talk with your sysadmin to see if they're blocking pip in any way or fashion – moosearch May 08 '20 at 16:01
  • LOL, the problem was that I needed to turn off my VPN. (I'm WFH via VPN.) Thanks for your time helping me! – 208_man May 11 '20 at 15:18
  • @mike_butak My work environment blocks any pip traffic and doesn't allow internet access unless it's connected to the VPN for the work-issued machines. Glad to know that your solution ended up working for you – moosearch May 11 '20 at 21:13
0

The solution was to turn off my corporate VPN. Doh!

208_man
  • 1,440
  • 3
  • 28
  • 59