1, sudo apt-get install openssl
2, cd python3.8/
3, sudo gedit /Modules/Setup
4,
# Socket module helper for socket(2)
_socket socketmodule.c timemodule.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
5, make
6, sudo make install
thanks: https://www.cnblogs.com/yuechaotian/archive/2013/06/03/3115472.html