ubuntu18.04 pip3 ssl error ImportError: No module named _ssl

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

Published 202 original articles · 80 praised · 300,000 views +

Guess you like

Origin blog.csdn.net/qxqxqzzz/article/details/105039431