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
相关推荐
ylscode8 小时前
Comodo防火墙曝致命零日漏洞:单个IPv6数据包即可触发Windows蓝屏死机
运维·网络·windows·安全·安全威胁分析
xiaofeichaichai8 小时前
网络请求与实时通道
前端·网络
德迅云安全-甲锵9 小时前
解析CDN防护核心原理:筑牢网络业务安全屏障
网络·安全
上海云盾第一敬业销售9 小时前
高防CDN与高防IP应用场景架构解析
网络协议·tcp/ip·架构
闪电悠米9 小时前
黑马点评-Redisson-01_why_redisson
java·服务器·网络·数据库·缓存·wpf
鹿鸣天涯10 小时前
网规第三版:第8章网络故障分析与处理案例
网络·软考·网络规划设计师
上海云盾-小余10 小时前
CN2 与 BGP 线路优劣拆解,按需选配规避延迟与攻击隐患
网络
星恒讯工业路由器11 小时前
星恒讯便携移动路由器的好处
网络·5g·智能路由器·信息与通信·wifi6·便携
tudoSearcher11 小时前
日志、指标、链路追踪:可观测性三支柱深度解析
运维·服务器·网络·prometheus