5

I installed python3.7 from here https://tecadmin.net/install-python-3-6-on-centos/ When trying to use/upgrade/install pip I got the following error:

[cloudera@quickstart Python-3.7.6rc1]$ sudo pip3 install --upgrade
WARNING: pip is configured with locations that require TLS/SSL,
however the ssl module in Python is not available.
ERROR: You must give at least one requirement to install (see "pip
help install")
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

Version information

[cloudera@quickstart Python-3.7.6rc1]$ pip3 --version
pip 19.2.3 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
[cloudera@quickstart Python-3.7.6rc1]$ whereis pip3
pip3: /usr/local/bin/pip3 /usr/local/bin/pip3.7
[cloudera@quickstart Python-3.7.6rc1]$ whereis pip
pip: /usr/bin/pip2.6 /usr/bin/pip /usr/local/bin/pip3.7
[cloudera@quickstart Python-3.7.6rc1]$ python3 --version
Python 3.7.6rc1
[cloudera@quickstart Python-3.7.6rc1]$ whereis openssl
openssl: /usr/src/openssl-1.0.2o/openssl.doxy
/usr/src/openssl-1.0.2o/openssl.spec
/usr/src/openssl-1.0.2o/openssl.pc /usr/bin/openssl /usr/lib64/openssl
/usr/local/bin/openssl /usr/include/openssl
/usr/share/man/man1/openssl.1ssl.gz

I tried several commands suggested here for this error but nothing helped. Can you help me?

UPDATE

[cloudera@quickstart Python-3.7.6rc1]$ sudo pip3 install upgrade pip
WARNING: pip is configured with locations that require TLS/SSL,
however the ssl module in Python is not available.
Collecting upgrade
  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/upgrade/
  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/upgrade/
  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/upgrade/
  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/upgrade/
  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/upgrade/
  Could not fetch URL https://pypi.org/simple/upgrade/: There was a
problem confirming the ssl certificate:
HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded
with url: /simple/upgrade/ (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
upgrade (from versions: none)
ERROR: No matching distribution found for upgrade
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

7 Answers 7

11

Follow this Steps:

pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org PACKAGE_NAME

Example --> pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org matplotlib

Hope this helps :)

Sign up to request clarification or add additional context in comments.

1 Comment

Try simply without any vpn or check if any kind of ssh tunneling should be off it worked for me.
1

You are probably missing some basic requirements for python. Try installing all of them with sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

4 Comments

libssl-dev is the one missing probably
I tried that but No package all of them Error: Nothing to do. How can I install them?
@gigives, You've already installed pip3. In the command sudo pip3 install --upgrade you are missing the argument (requirement to install). If you just want to upgrade pip itself, you need to do pip3 install --upgrade pip (you could run it with sudo, but it's not generally a good practice ).
hello @kenichi, and then I become the same error. Please look at my updated question.
1

Solution:

After going through everywhere, I ended up uninstalling python and vs code. Deleted all the vs code, python, and pip cache files saved under %AppData%. Reinstalled python and vs code.

Success.

pip is 19.0.3 and I am keeping it this way because I think the problem started when I updated it to 20.3.3. Once you update to 20.3.3, you're not going to be able to downgrade it because of the SSL error.

Comments

0

I fixed this by starting pip while in the directory where the executable resides. Permanent fix was to add the required bin & scripts directories to Path.

Don't forget to restart docker and ensure you have connectivity to the internet.

Comments

0

We met the same issue when we installed python3.11. The reason for this error is that the old openssl is used. Here is my solution

  • Install openssl1.1.1

    sudo yum install -y openssl11 openssl11-devel
    

    If you met the error openssl11-devel conflicts with 1:openssl-devel, one solution is remove the old openssl

    sudo yum remove openssl-devel.x86_64
    sudo yum autoremove
    sudo yum install -y openssl11 openssl11-devel
    
  • Then reinstall Python3.11 again

    ./configure --enable-optimizations
    sudo make altinstall
    

Comments

0

It only worked with me when I wrote package at first and added --user

pip install <package-name> --user --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org

Comments

-2

Please try the install command by adding the trusted hosts to pip as follows as answered here

sudo pip3 install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org -upgrade pip

I like this write up on the explanation of the problem and other solutions.

1 Comment

your syntax is not working at all. mind correcting it ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.