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
相关推荐
ivy159868377151 小时前
芯锦科技 HP9117 多协议USB Type-A快充识别芯片
网络·科技·网络协议·5g·信号处理·p2p
西红市杰出青年2 小时前
MCP 的三种数据传输模式教程(stdio / SSE / Streamable HTTP)
网络·网络协议·http·ai
.select.2 小时前
HTTPS 如何优化?
网络协议·http·https
Filotimo_2 小时前
内网穿透概念
网络
minji...3 小时前
Linux 进程间通信(三)命名管道
linux·服务器·网络
kongba0074 小时前
OpenClaw v2026.3.23 安全配置复盘:从多处明文到集中受控存储《OpenClaw 安全部署 SOP(v2026.3.23)V2》
服务器·网络·安全
三三有猫4 小时前
HTTP、HTTPS和SOCKS代理怎么选?
网络协议·http·https
郭涤生5 小时前
CANopen 基础复习
服务器·网络·c++
normanhere5 小时前
H3C无线调优案例
网络
饿了吃洗衣凝珠5 小时前
hcip 作业
网络