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
相关推荐
小米里的大麦1 小时前
050 传输层 —— UDP
网络·网络协议·udp
adnyting1 小时前
【Linux日新月异(六)】CentOS 7网络命令深度解析:从传统到现代网络管理
linux·网络·centos
陌路203 小时前
Linux35 TCP状态转换图
网络·网络协议·tcp/ip
Awkwardx3 小时前
Linux网络编程—应用层自定义协议与序列化
linux·网络
极客BIM工作室4 小时前
LSTM门控机制:本质是神经元构成的小型网络
网络·机器学习·lstm
qq_278984137 小时前
ubuntu vlan网络设置
linux·服务器·网络
J***Q2929 小时前
后端服务网格安全,mTLS加密通信
网络·安全
wa的一声哭了12 小时前
WeBASE管理平台部署-WeBASE-Web
linux·前端·网络·arm开发·spring boot·架构·区块链
YJlio12 小时前
进程和诊断工具学习笔记(8.19):Hyper-V 来宾调试与符号配置 —— 在虚拟化场景下用 LiveKd 抓现场
网络·笔记·学习