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
相关推荐
Flying_Fish_roe3 小时前
linux-网络管理-网络抓包
linux·网络·php
小技与小术5 小时前
lvs-nat模式实验详解
linux·运维·服务器·网络·lvs
喵不拉几5 小时前
WebSocket 协议
网络·websocket·网络协议
晓生谈跨境6 小时前
网络丢包现象使用什么协议可以缓解
网络
大嘴巴子6 小时前
华为ensp中vlan与静态路由技术的实现
网络·智能路由器
加油,旭杏6 小时前
【Linux】NAT
linux·网络·智能路由器·nat·nart
胡俊杰5397 小时前
9月18日
服务器·网络
小堃学编程7 小时前
计算机网络(六) —— http协议详解
网络协议·计算机网络·http
月临水8 小时前
JavaEE:网络编程(套接字)
java·网络·java-ee