1

I am new to Python and need to download some modules for a project that I am doing, however, I am getting this error whenever I try to download pip. Would this error be as a result of a firewall? If so, is there any way I can get around to installing pip?

U:\>Py get-pip.py
WARNING: pip is configured with locations that require TLS/SSL, however 
the ssl module in Python is not available.
Collecting pip
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 'SSLError("Can't connect to HTTPS 
URL 
because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 'SSLError("Can't connect to HTTPS 
URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 'SSLError("Can't connect to HTTPS 
URL because the SSL module is not available.")': /simple/pip/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 'SSLError("Can't connect to HTTPS 
URL 
 because the SSL module is not available.")': /simple/pip/
 WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, 
 status=None)) after connection broken by 'SSLError("Can't connect to 
HTTPS 
  URL because the SSL module is not available.")': /simple/pip/
  Could not fetch URL https://pypi.org/simple/pip/: There was a problem 
 confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', 
 port=443): Max retries exceeded with url: /simple/pip/ (Caused by 
 SSLError("Can't connect to HTTPS URL because the SSL module is not 
 available.")) - skipping
 ERROR: Could not find a version that satisfies the requirement pip (from 
 versions: none)
 ERROR: No matching distribution found for pip
 WARNING: pip is configured with locations that require TLS/SSL, however 
 the 
ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem 
confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', 
port=443): Max retries exceeded with url: /simple/pip/ (Caused by 
SSLError("Can't connect to HTTPS URL because the SSL module is not 
available.")) - skipping
Kaori21
  • 43
  • 11
  • if you have python installed you already have pip, just use ` python -m pip install ` – kederrac Aug 13 '19 at 07:08
  • 1
    https://stackoverflow.com/questions/54394764/pip-is-configured-with-locations-that-require-tls-ssl-however-the-ssl-module-i/54394791 – Barış Akkurt Aug 13 '19 at 07:15
  • Just use the [python installer for windows](https://www.python.org/ftp/python/3.7.4/python-3.7.4.exe). It will install pip automatically and add both `python` and `pip` to $PATH. – CodeIt Aug 13 '19 at 07:18
  • @CodeIt Oh if that is the case then I may already have it since that is where I downloaded it from yesterday. However, whenever I open Python 3.7 and type in 'pip install networkx' it would just tell me 'invalid synatx' – Kaori21 Aug 13 '19 at 07:21
  • @ElizabethDC You are opening python interpreter. `pip` cannot be used inside the interpreter. Just open CMD and type `pip --version` to see if it is already installed. – CodeIt Aug 13 '19 at 07:22
  • @ElizabethDC See if you have pip installed. – CodeIt Aug 13 '19 at 07:23
  • @CodeIt I have just input this on command prompt just now and it said that 'pip' is not recognized as an internal or external command – Kaori21 Aug 13 '19 at 07:23
  • @CodeIt I have had this same problem when I just type in Python, and it didn't work, but when I typed in py, it confirmed it – Kaori21 Aug 13 '19 at 07:24
  • @ElizabethDC Usually when you install using the installer. It will ask you whether to add python to path. If you have not checked that box, it will not add python to $PATH. If you not sure what to do to solve this, you can try re-installing python using the installer. This time make sure you are checking the option to add python to $PATH. – CodeIt Aug 13 '19 at 07:25
  • @CodeIt Thank you I am currently now uninstalling Python to reinstall again. I will give this a go and will update you on what happens. – Kaori21 Aug 13 '19 at 07:29

2 Answers2

0

You need to install OpenSSL, if your OS is Windows.

get-pip.py tries to extract the SSL certificates from requests in order to verify the pypi.org as a trusted host. Chances are your python --version installation was not built with SSL support, due to the unavailability of openSSL binaries within your OS. On the second thought, make sure your python binaries and lib are added into your system PATH variable.

Once OpenSSL installed run py get-pip.py.

In order to make sure pip is installed, run pip --version in your command prompt.

Further, installing other modules using pip behind a corporate firewall can be done using a proxy with your pip install commands.

pip install --proxy http://user:password@proxyserver:port <module-name>
Deepansh
  • 73
  • 7
  • Do I just install OpenSSL and would it then allow me to install pip? Would I need to do anything else after downloading openssl? – Kaori21 Aug 13 '19 at 07:19
  • @ElizabethDC After installing OpenSSL, you need to run `Py get-pip.py` to install `pip`. – CodeIt Aug 13 '19 at 07:20
  • @CodeIt Would it also let me download other modules as well? I have tried using anaconda prompt to get modules or even just from the anaconda environment but the firewall at my workplace would not let me do so. I have just been trying to figure out how I could go about downloading modules without tinkering about things too much – Kaori21 Aug 13 '19 at 07:22
  • In order to get through the firewall while installing other modules. You can use proxy as specified [here](https://pip.pypa.io/en/stable/user_guide/#using-a-proxy-server). Also you should Command Prompt instead of Anaconda Prompt in order to install pip. For some reasons Anaconda Prompt fails to verify the SSL Certificate as discussed [here](https://stackoverflow.com/questions/49943410/pip-ssl-error-on-windows) – Deepansh Aug 13 '19 at 07:30
-1
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

For this kind of problems is better to use github, copy and paste google and check for github issues.

pedro_bb7
  • 1,601
  • 3
  • 12
  • 28