I'm on Ubuntu 22.04.1 which comes whit its own python3.11, where pip works perfectly.
If I install other python versions through apt-get (sudo apt-get install python3.10) the related pip works perfectly.
But I just installed an alternative python version (3.7.9 ) from source (I'm not able to use apt for this python version), doing the following
cd usr/lib
sudo wget https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz
sudo tar xzf Python-3.7.9.tg
cd Python-3.7.9
sudo ./configure --enable-optimizations
sudo make altinstall
Python3.7 works fine, but if I try to install any package (using pip3.7 or, after creating a virtualenv based on python3.7, using pip) I get the following warning
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Followed by the error
ERROR: Could not find a version that satisfies the requirement numpy (from versions: none)
ERROR: No matching distribution found for numpy
I'm sure I have Openssl installed because other versions of python don't give probelms with pip (also I can see ssl in the folder /etc/ssl) so the problem seems to be related only on a link between ssl and python installed from source.
Any suggestions?
sudowhen you don't really need it. You don't needsudoto download and compile, only need it formake install../configure. Yes, it's large and mostly boring. But there're hidden gems in the pile. Especially watch problems with absent libraries._ssl.somodule you need OpenSSL development files (headers and link libraries). I'm not 100% sure but I think you needsudo apt install openssl-devel. After that clean, reconfigure and recompile Python. Like this:sudo chown -R $USER . && make distclean && ./configure && make && sudo make altinstallsudo apt install libssl-dev