ModuleNotFoundError: No module named '_ssl'
查看pip安装了哪些模块
pip list
打开源码包中的文件
vim /opt/download/Python-3.11.2/Modules/Setup
自带的openssl版本太低了 重新编译和安装 openssl
wget https://www.openssl.org/source/openssl-1.1.1s.tar.gz
tar -zxf openssl-1.1.1s.tar.gz
./configure
make
make install
重新安装python3.11
./configure --prefix=/usr/local/python-3.11.2 --with-zlib=/usr/include/ --with-openssl-rpath=auto --with-openssl=/usr/include/openssl OPENSSL_LDFLAGS=-L/usr/include/openssl OPENSSL_LIBS=-l/usr/include/openssl/ssl OPENSSL_INCLUDES=-I/usr/include/openssl
make
make install
导入模块测试
pip 阿里的源报错
vim ~/.pip/pip.conf
[global]
index-url = http://pypi.douban.com/simple
[install]
use-mirrors =true
mirrors =http://pypi.douban.com/simple/
trusted-host =pypi.douban.com