ModuleNotFoundError: No module named ‘_ssl‘

一、安装openssl

复制代码
wget http://www.openssl.org/source/openssl-1.0.2k.tar.gz
tar -xzf openssl-1.0.2k.tar.gz
cd openssl-1.0.2k

./config --prefix=/usr/local/openssl
./config -t
make
make install

二、安装python(3.8.10为例)

复制代码
tar -zxvf Python-3.8.10.tgz
cd Python-3.8.10
vim Modules/Setup,解除注释206、210、211、212、213行,,解除注释后如下:
		'''
		_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
		'''
./configure --prefix=/usr/local/python38
make && make install
相关推荐
上海云盾商务经理杨杨19 小时前
2026游戏盾深度解析:从被动防御到智能作战,构建DDoS免疫堡垒
网络·游戏·ddos
强子感冒了19 小时前
Java网络编程学习笔记,从网络编程三要素到TCP/UDP协议
java·网络·学习
上海云盾商务经理杨杨21 小时前
付费网站的攻防战:2026年,如何破解并抵御爬虫攻击
网络·安全
emma羊羊21 小时前
【wordpress-wpdiscuz-rce】
网络·web安全·wordpress
青果全球http21 小时前
静态IP是什么意思?和动态IP有什么区别
网络·网络协议·tcp/ip
Anthony_23121 小时前
一、网络通信的本质与OSI模型
网络·网络协议·tcp/ip·http·https·udp·ssl
wwangxu21 小时前
路由与交换技术基础
网络协议·tcp/ip·udp
河码匠21 小时前
VXLAN 简介、实现虚拟机跨物理机通信和网络隔离
网络·vxlan
旖旎夜光1 天前
Linux(11)(中)
linux·网络
猿码优创1 天前
过滤境外ip和域名访问的解决方案
网络·网络协议·tcp/ip·安全·阿里云