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
相关推荐
数据安全科普王18 分钟前
打破中心枷锁:P2P网络如何用“去中心化”重构互联网通信
网络·去中心化·p2p
爱吃烤鸡翅的酸菜鱼32 分钟前
CANN ops-nn激活函数与池化算子深度解析
网络·开源·aigc
saber_andlibert2 小时前
TCMalloc底层实现
java·前端·网络
飞凌嵌入式3 小时前
用「EN 18031认证」通关欧盟,这张 “网络安全护照” 已就位
网络·安全·能源
Trouvaille ~3 小时前
TCP Socket编程实战(三):线程池优化与TCP编程最佳实践
linux·运维·服务器·网络·c++·网络协议·tcp/ip
JoySSLLian5 小时前
手把手教你安装免费SSL证书(附宝塔/Nginx/Apache配置教程)
网络·人工智能·网络协议·tcp/ip·nginx·apache·ssl
Zach_yuan5 小时前
自定义协议:实现网络计算器
linux·服务器·开发语言·网络
猫头虎5 小时前
如何解决 OpenClaw “Pairing required” 报错:两种官方解决方案详解
网络·windows·网络协议·macos·智能路由器·pip·scipy
charlotte102410246 小时前
高并发:关于在等待学校教务系统选课时的碎碎念
java·运维·网络
Zaralike6 小时前
Linux 服务器网络不通排查 SOP(标准操作流程)
linux·服务器·网络