V
V
Vasily Nikonov2021-01-14 10:36:14
Python
Vasily Nikonov, 2021-01-14 10:36:14

How to install Python pip packages when Python is built from source?

There was a need to install a second Python interpreter. There is one installed from the official site (installation package for macOS), but there is a need for a second interpreter. Needed, in particular, because of the Numba compiler.

Installed Python 3.8.6 on macOS from sources.

spoiler
$ mkdir .python
$ cd .python 
$ wget https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tgz
$ tar zxvf Python-3.8.6.tgz
$ cd Python-3.8.6
$ ./configure --enable-optimixation --prefix=*path/to/.python*
$ sudo make
$ sudo make altinstall


Python itself is fully functional, runs Shell, you can run various scripts through it, you can even create a virtual environment. But when the question arose about the need to install an external package, then through pip3.8, which became along with Python, it gave the following error that (as I understand it) pip3.8 is configured locally and it does not see something.
spoiler
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
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/numba/
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/numba/
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/numba/
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/numba/
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/numba/
Could not fetch URL https://pypi.org/simple/numba/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/numba/ (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 numba (from versions: none)
ERROR: No matching distribution found for numba
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


Good people, tell me, please, how to solve this problem. Thank you.

PS I googled this problem on the Internet, but I did not find a clear answer.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-01-14
@shabelski89

Apparently the error is that there is no SSL - "Can't connect to HTTPS URL because the SSL module is not available."
You need to either install openssl or fix the path

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question