Error message:
Can‘t connect to HTTPS URL because the SSL module is not available.
When you connect to HTTPS, you are prompted that SSL is not available
Test
# 进入python$ python3 # or python3.6
# 导入SSL模块>>> import ssl
If the following prompt appears, Python does not support SSL.
Solution Download File
Openssl
$ wget http://www.openssl.org/source/openssl-1.0.2e.tar.gz
Python3.6-Select the desired version
$wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz
Installing OpenSSL
# 解压文件tar xvzf openssl-1.0.2e.tar.gz# 进入目录$ ./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl
$ make$ make test$ sudo make install
Python Entry Directory
#解压$ tar xvzf Python-3.6.2.tgz$ cd Python-3.6.2
Modify the installation configuration
Use Vim to open file Modules/Setup.dist
files, search SSL, cancel four lines of comments
$ vim Modules/Setup.dist
Start installation
Complete the above operation to install, execute the following 3 lines of code
$ ./configure$ make$ sudo make install
Complete!
No accident has been installed to complete, the following detection.
$ python3
>>> import ssl
without an error, it has been successful!
Ubuntu 16.04 Python 3.x installation OpenSSL