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
相关推荐
明月_清风20 小时前
开发者网络概念全扫盲:一篇搞定
后端·网络协议
刘马想放假1 天前
Modbus 全栈技术解析:TCP、RTU、ASCII、RTU over TCP
数据结构·网络协议
王二端茶倒水2 天前
一套可落地的无线运营方案,不能只管 AP,还要管用户、计费和运维
网络协议
162723816082 天前
EtherCAT 分布式时钟(DC)原理与配置实战:把多轴真正"对齐到同一时刻"
网络协议
王二端茶倒水3 天前
宽带无线项目,怎么从一次性交付变成长期运营收入?
网络协议
用户2530171996274 天前
第6篇:从技术到产品 — Ghost Proxifier 的设计哲学
网络协议
用户2530171996274 天前
第3篇:注入的艺术 — Ghost Proxifier 核心架构拆解
网络协议
王二端茶倒水5 天前
商业 WiFi 不是免费上网,而是门店数字化的入口
网络协议
网络研究院10 天前
2026年网络安全
网络·安全·法律·法规·趋势·发展