Installing OpenSSL and Openssl-devel packages
Yum-y Install OpenSSL Openssl-devel
Download the latest version of Python3 on the website
Https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz
Unzip the Python installation package (I put it under/root by default)
Cd/root
Tar xzvf python-3.5.1.tgz
Enter the Python source code folder, go to the Modules folder, modify the Setup.dist, and make IT support sending HTTPS requests.
Cd/root/python-3.5.1/modules
Vim Setup.dist
Will
# Socket Module helper for SSL support; You must comment out of the other
# socket line above, and possibly edit the SSL variable:
#SSL =/usr/local/ssl
#_ssl _ssl.c \
#-duse_ssl-i$ (SSL)/include-i$ (SSL)/INCLUDE/OPENSSL \
#-l$ (SSL)/lib-lssl-lcrypto
Revision changed to
# Socket Module helper for SSL support; You must comment out of the other
# socket line above, and possibly edit the SSL variable:
Ssl=/usr/local/ssl
_ssl _ssl.c \
-duse_ssl-i$ (SSL)/include-i$ (SSL)/INCLUDE/OPENSSL \
-l$ (SSL)/lib-lssl-lcrypto
Compile the installation and set the installation directory to/usr/local/python-3.5 to avoid conflicts with the Python2 installed on the system.
./configure--prefix=/usr/local/python-3.5
Make
Make install
This article is from the "jiazheming" blog, make sure to keep this source http://8888866666.blog.51cto.com/6988153/1785699
Installation Configuration python3.5