I am installing python 3.6.9 from source. I followed below this link to install python. But i am facing issue when i try to import ssl library.
The error i am getting is ModuleNotFoundError: No module named '_ssl'
.
I followed this link to install openssl from source but still i am getting same error. I don't know what am i missing. I recompiled python after openssl installation but still getting the same error.
I cannot use yum as my linux environment doesnt support internet.
Update: Steps i have done are below mentioned.
1. wget http://www.openssl.org/source/openssl-1.0.2e.tar.gz
2. ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl
3. $ make
$ make test
$ make install
4. wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tar.xz
5. tar xJf Python-3.6.9.tar.xz
6. vim Modules/Setup.dist
uncommented the ssl code
_socket socketmodule.c
# Socket module helper for SSL support; you must comment out 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
7. ./configure
make
make install