Python compilation and installation require ssl module to use pip, and ssl needs to support x509,
If the openssl version is too low, the corresponding ssl module cannot be installed. If you support ssl, you can see during configure:
The following does not require administrator rights.
Solution: compile and install the latest version of openssl:
Download link: https://www.openssl.org/source/
Enter the folder after decompression:
. /config --prefix=/openssl/install/path
make
make install
/openssl/install/path is the installation directory, which is needed below.
At the same time, add bin to the PATH of the environment variable and add lib to the link library.
openssl version
Modify the python setup file and enter the python file directory:
cd Modules
vim Setup
Modify the corresponding file to the following:
Note that you must modify the content behind SSL= to your own openssl installation directory
In the python file directory:
. /configure --prefix=/python/install/path --with-openssl=/openssl/install/path
make -j8
make install
You can see after ./configure:
Then it can be installed successfully and all modules that require ssl can be used.