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
相关推荐
I · T · LUCKYBOOM1 小时前
iptables防火墙
linux·运维·服务器·网络·安全
_Orch1d3 小时前
详解SSL/TLS协议握手协议、记录层协议与警报协议
网络·计算机网络·安全·密码学·ssl·身份认证·对称加密
chenyuhao20243 小时前
Linux网络编程:HTTP协议
linux·服务器·网络·c++·后端·http·https
duration~3 小时前
IPv6 详解
网络·网络协议·ip
广东大榕树信息科技有限公司3 小时前
动环监控如何有效提升机房环境管理的可靠性与响应速度?
运维·网络·物联网·国产动环监控系统·动环监控系统
zhengfei6115 小时前
【POC漏洞】XXX网上阅卷系统 monitor 未授权访问
网络·安全·web安全
福尔摩斯张6 小时前
Linux的pthread_self函数详解:多线程编程中的身份标识器(超详细)
linux·运维·服务器·网络·网络协议·tcp/ip·php
ArrebolJiuZhou6 小时前
02arm指令集(一)——LDR,MOV,STR的使用
linux·网络·单片机
一只旭宝6 小时前
Linux专题八:生产者消费者,读写者模型以及网络编程
linux·网络
代码游侠6 小时前
复习——网络基础知识
网络·笔记·网络协议·算法·http