Pip is configured with locations that require tls ssl however the ssl module

Pip is configured with locations that require tls ssl however the ssl module

SSL module in Python is not available (on OSX)

UPDATE: Here’s some more info:

Yes, I have both 3.6.5_1 and 3.7.4_1 installed as I may need to switch between the two at times.

9 Answers 9

Trending sort

Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.

It falls back to sorting by highest score if no posts are trending.

Switch to Trending sort

The ssl module as well as its underlying C extension appears to be a part of the python formula:

so it being missing most probably means package installation corruption which brew reinstall python should fix.

Also note that while Homebrew allows multiple versions to coexist, its installation logic isn’t quite designed to keep the alternative versions operational unless they are installed via a versioned formula (and e.g. routinely removes old versions in the regular brew cleanup ).

Mac OSX Catalina (and same issue on OSX Mojave) Pyenv

For anyone searching this topic, I had the same presenting problem, but had Python installed via both Homebrew and Pyenv!! It would have been better (IMO) to just use Pyenv to easily manage versions. As mentioned by @ivan_pozdeev in their answer, but here’s some detail you might want.

If your situation is similar, none of the above solutions would be quite enough to set things right. Partially I was helped by a Pyenv related answer here: https://stackoverflow.com/a/51797298/3084820 I also happened to have pyenv-virtualenv installed, so mentioning that as well, as it’s common to use these two together.

I finally took the following steps to resolve the issue:

Now, for a clean installation manageable with Pyenv:

This gave me a clean, working install of Python 3.6.10, and if I wanted or needed to, I could install a different version and switch between with Pyenv.

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available

I’m using Kali Linux 2020.1, I installed Python3.7, then after trying to install modules using pip3 command I keep getting this error message.

Pip is configured with locations that require tls ssl however the ssl module. Смотреть фото Pip is configured with locations that require tls ssl however the ssl module. Смотреть картинку Pip is configured with locations that require tls ssl however the ssl module. Картинка про Pip is configured with locations that require tls ssl however the ssl module. Фото Pip is configured with locations that require tls ssl however the ssl module

4 Answers 4

I think you may have inadvertently installed without something it needs. The error looks similar to one generated by the python requests library.

I would check this is properly installed and it’s dependencies are met. I notice that python-openssl is only a suggested package and not a required one. You might want to see if installing this one helps.

To do we must compile it and install each dependency

update pip with command

install any dependency using pip3 install like

This solution worked very well for me:

I make a summary of the procedure:

Steps

I decided to just install openSSL again by pulling down the newest version of the source code.

By default, Python isn’t going to look here. We need to fix that. To begin, run the first part of the Python install script (as seen below).

Now STOP, cd to /tmp/Python37/Python-3.7.0 and open up the file Modules/Setup.dist

You should see the following lines COMMENTED.

What you need to do is UNCOMMENT these lines so that they are seen during our Python compile. Now you can finish up by running that last few lines of our python script.

At this point I now had a working python and pip (mapped to python3.7 and pip3.7 in my path).

Trying to install packages with Python 3.7.2 pip causes TSL/SSL errors

Multi-python environment. It has both Python 2.7.15 and 3.7.2 installed.

Regular (Python2) pip works without a hitch.

When I try to run pip3 install flask I get the following errors:

The same error appears if I try to install any other package.

pip3 version is 18.1

Installing ca-certificates did not help

Python 3 installed according to the following guide: https://stackoverflow.com/a/8112006/8826349

EDIT: I now noticed, that when running make on Python 3, it finished successfully, but had the following message:

My issue seems to be identical to this. However the thread does not provide any solutions beyond describing the problem.

I’ve tried to compile a newer version of openssl using this guide. But newer openssl version did not resolve my issue.

I was unable to find a solution for this issue.

It seems that Amazon’s Linux version does not work well with Python 3.

They do have a different OS, called Amazon Linux 2, where installiing Python 3 is as easy as running yum install python3

Pip is configured with locations that require tls ssl however the ssl module. Смотреть фото Pip is configured with locations that require tls ssl however the ssl module. Смотреть картинку Pip is configured with locations that require tls ssl however the ssl module. Картинка про Pip is configured with locations that require tls ssl however the ssl module. Фото Pip is configured with locations that require tls ssl however the ssl module

2 Answers 2

Trending sort

Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.

It falls back to sorting by highest score if no posts are trending.

Switch to Trending sort

So, SSLError(«Can’t connect to HTTPS URL because the SSL module is not available.») in this context indicates that when you compiled python3.7 from sources, it wasn’t linked against your system OpenSSL library. The pedantic solution would be to ensure you have the required headers besides the lib, with something like:
$ yum install openssl-devel.x86_64 openssl.x86_64
and recompile from scratch, linking against the OpenSSL lib.

However, as you have rightly noted, installing python3 with yum (from Amazon’s own repo, packages tested for Amazon Linux) is way easier and more robust approach in EC2, and will resolve all dependencies. For example, something like this is going to work in Amazon Linux (version 1):

Usually, Python3.6 is already pre-installed in EC2, but not python36-pip.

/.local/lib/) rather than for the whole system, which is actually a good practice to avoid interfering with the system python packages.

«WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.» Ubuntu 21.04 Python 3.8.10

I recently upgraded to Ubuntu 21.04 that comes with Python 3.9.4 but I needed to create a virtual environment with 3.8.

Problem is when I go and try installing wheel I get this error: WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

I don’t get the same error if I use the system python version to create a venv.

I checked the (many) other questions related to this but most of them are for windows or mac or a remote installation, I’m on a local machine.

Pip is configured with locations that require tls ssl however the ssl module. Смотреть фото Pip is configured with locations that require tls ssl however the ssl module. Смотреть картинку Pip is configured with locations that require tls ssl however the ssl module. Картинка про Pip is configured with locations that require tls ssl however the ssl module. Фото Pip is configured with locations that require tls ssl however the ssl module

1 Answer 1

libssl-dev is required to build the ssl module from source.

If you install Python from the package repositories, you will be installing a pre-built binary, so you won’t need the openssl development files on your own machine, because these files are sort of ‘baked-in’ to the release.

But if you build Python from source yourself, you will need to install the libssl-dev (openssl development files) package in order to build Python with the ssl module.

You can check whether you have libssl-dev installed by looking at the output of:

If it is not installed, you can install it with (may require privileges e.g. sudo ):

If you then rebuild Python from source the ssl module should be available.

NOTE: There are other dependencies too which might be missing and result in a less than fully-functional Python installation. Pay attention to the output you get when building. A (maybe incomplete) list of these dependencies’ names in the Ubuntu repositories is: libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

i cannot install or upgrade pip «ssl error» #5448

Comments

saisk73 commented May 29, 2018

The text was updated successfully, but these errors were encountered:

liangdongyang commented Jun 4, 2018 •

pradyunsg commented Jun 4, 2018 •

That said, that can open you up to potential security issues.

fenchu commented Jun 6, 2018

Hi
New python 3.6.5 install on win10, You need to upgrade to pip 10.0.1 manually for trusted-host to work

But still cert fails:

I believe this is because somone have upgraded the ssl certs recently:

pradyunsg commented Jun 6, 2018

pradyunsg commented Jun 6, 2018

Closing as a duplicate of #4459.

Jvikrant commented Sep 27, 2018

@fenchu you saved the day man.. thank you very much for elaborated explanation

cuevasDev commented Jan 11, 2019

ajsjagadesh commented Mar 3, 2019

Pip is configured with locations that require tls ssl however the ssl module. Смотреть фото Pip is configured with locations that require tls ssl however the ssl module. Смотреть картинку Pip is configured with locations that require tls ssl however the ssl module. Картинка про Pip is configured with locations that require tls ssl however the ssl module. Фото Pip is configured with locations that require tls ssl however the ssl module
i am getting this error plz give the solution

ghost commented Mar 14, 2019

@ajsjagadesh i’m getting the same thing idk

Mahnas92 commented Apr 11, 2019

I am getting the same issue, and all replies here seems to assume this error only happens if you already have some PIP version installed.
What do I do if I don’t have PIP installed at all?

eriklarson33 commented Apr 13, 2019

eriklarson33 commented Apr 13, 2019

I’m still getting the same issue. Not sure this is resolved. The only difference is that I’m trying to install the requests library and not flask.

eriklarson33 commented Apr 13, 2019

I am getting the same issue, and all replies here seems to assume this error only happens if you already have some PIP version installed.
What do I do if I don’t have PIP installed at all?

cdauth commented Apr 19, 2019

I came across this error while operating in a chroot environment. I solved it by running on the host system:

sathiql commented Apr 26, 2019

sathiql commented Apr 26, 2019

lock bot commented May 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Источники информации:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *