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
相关推荐
志栋智能16 分钟前
告别高昂投入:超自动化IT运维的轻量化实践
大数据·运维·网络·人工智能·自动化
黄昏晓x2 小时前
Linux----网络
linux·网络·arm开发
sensen_kiss2 小时前
CAN302 电子商务技术 Pt.1 Web技术导论
前端·网络·学习
攻城狮在此2 小时前
华为LACP链路聚合配置(三层聚合)
网络·华为
AttaGain2 小时前
【Ubuntu配置VLAN网络】
linux·网络·ubuntu
网安Ruler3 小时前
DoIP (基于 IP 的诊断通信协议)分析与理解
网络·tcp/ip·汽车
线束线缆组件品替网4 小时前
Amphenol RJE1Y36610644401 CAT6A网线组件选型与替代指南
网络·人工智能·数码相机·电脑·音视频·硬件工程·游戏机
码出钞能力4 小时前
Linux的弱主机模型(TCP/IP协议的弱端系统)
linux·网络·tcp/ip
布史4 小时前
Prometheus Python Client 实操指南:从零实现自定义 Exporter
网络·python·prometheus
默|笙4 小时前
【Linux】进程信号(1)_信号产生
linux·服务器·网络