python3.10.5安装时openssl安装失败的问题

article/2025/7/8 15:48:05

初始问题:编译安装python后执行pip list 报错

[root@VM-0-6-centos Python-3.10.5]# pip3 list
Package    Version
---------- -------
pip        22.0.4
setuptools 58.1.0
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
[root@VM-0-6-centos Python-3.10.5]# 

解决办法:
参考链接更新openssl版本:https://blog.csdn.net/tfstone/article/details/109223506,更新版本至3.0.3

更新后,问题依旧存在,检查编译过程,发现编译失败的问题

building '_ssl' extension
gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include -I/usr/local/python/python3_10_5/include -I. -I/usr/local/include -I/data/python/Python-3.10.5/Include -I/data/python/Python-3.10.5 -c /data/python/Python-3.10.5/Modules/_ssl.c -o build/temp.linux-x86_64-3.10/data/python/Python-3.10.5/Modules/_ssl.o
gcc -pthread -shared build/temp.linux-x86_64-3.10/data/python/Python-3.10.5/Modules/_ssl.o -L/usr/local/python/python3_10_5/lib -L/usr/local/lib -lssl -lcrypto -o build/lib.linux-x86_64-3.10/_ssl.cpython-310-x86_64-linux-gnu.so
building '_hashlib' extension
gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include -I/usr/local/python/python3_10_5/include -I. -I/usr/local/include -I/data/python/Python-3.10.5/Include -I/data/python/Python-3.10.5 -c /data/python/Python-3.10.5/Modules/_hashopenssl.c -o build/temp.linux-x86_64-3.10/data/python/Python-3.10.5/Modules/_hashopenssl.o
gcc -pthread -shared build/temp.linux-x86_64-3.10/data/python/Python-3.10.5/Modules/_hashopenssl.o -L/usr/local/python/python3_10_5/lib -L/usr/local/lib -lssl -lcrypto -o build/lib.linux-x86_64-3.10/_hashlib.cpython-310-x86_64-linux-gnu.so
*** WARNING: renaming "_ssl" since importing it failed: /data/python/Python-3.10.5/build/lib.linux-x86_64-3.10/_ssl.cpython-310-x86_64-linux-gnu.so: undefined symbol: OPENSSL_sk_num
*** WARNING: renaming "_hashlib" since importing it failed: /data/python/Python-3.10.5/build/lib.linux-x86_64-3.10/_hashlib.cpython-310-x86_64-linux-gnu.so: undefined symbol: EVP_MD_get_typeThe following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc                  pwd                   time               Following modules built successfully but were removed because they could not be imported:
_hashlib              _ssl                                     Could not build the ssl module!
Python requires a OpenSSL 1.1.1 or newer

根据报错信息,需要 1.1.1版本以上的openssl,显然条件已经满足,那么应该是旧环境未清理干净所致,严格按照流程重新安装编译

在这里插入图片描述

最重要是第10步,指定编译依赖库为新版本openssl相关依赖,这里的路径需要根据安装目录灵活配置,例如:

 export LD_LIBRARY_PATH=/usr/local/openssl/lib64:$LD_LIBRARY_PATH

http://chatgpt.dhexx.cn/article/chZJNQm4.shtml

相关文章

LINUX安装openssl

openssl 官网下载 https://www.openssl.org/source/old/ 1、解压openssl包: tar -xzf openssl-1.1.1n.tar.gz2、得到openssl-1.1.1n目录,然后进入openssl-1.1.1n目录中,安装openssl到 /usr/local/openssl 目录,安装之后&#xff…

openssl安装教程(windows7系统,超详细)

openssl安装教程 1.安装包安装1.1所需资源链接1.2安装流程1.3测试是否安装成功1.4安装过程中的问题 2.自己编译源码再安装 1.安装包安装 1.1所需资源链接 openssl安装包下载地址:http://slproweb.com/products/Win32OpenSSL.html 如果用谷歌浏览器打开的话&#x…

在Window 10 64位电脑上安装 OpenSSL安装过程

前期准备 安装最新版的ActivePerl到https://www.openssl.org 下载最新OpenSSL源码到http://www.nasm.us 下载NASM汇编工具在开始任务栏里打开vc2010的工具文件夹,如图所示: 选择Visual Studio命令提示(如果是编译64位的openssl,应该打开的…

windows下OpenSSL安装

官网下载地址:https://www.openssl.org/source/ 项目GitHub地址: https://github.com/openssl/openssl 其他下载地址:http://slproweb.com/products/Win32OpenSSL.html https://oomake.com/download/openssl 一、下载openssl安装版 二、修…

OpenSSL安装及查看版本号

1、安装OpenSSL 下载链接 安装按照提示即可 2、添加系统path环境变量 D:\OpenSSL-Win64\OpenSSL-Win64\bin3、查看OpenSSL版本号 openssl version 或者 openssl version -a

openssl安装方式(Ubuntu下)

openssl安装方式 官方网站1、解压2、编译安装3、生成 软连接4、测试 官方网站 https://www.openssl.org/source/ 1、解压 我这里 安装的版本时1.0.2,其实都一样 ,默认版本 是1.1.1 拿到 源码后先解压源码文件 openssl-1.0.2u.tar.gz2、编译安装 进…

Linux查找openssl文件夹,Linux下OpenSSL 安装详解 +图解

安装环境: 操作系统:redhat 12.0 OpenSSL Version:openssl-0.9.8l Download 安装包(Linux source) :openssl-0.9.8l.tar.gz(or the latest version of openssl)下载地址: 在linux下解压缩下载到的安装包,命令如下.....tar -xzf op…

OpenSSL安装升级

官网:/source/index.html 当前(2020-10-22)最新稳定版本:https://www.openssl.org/source/openssl-1.1.1h.tar.gz Note: The latest stable version is the 1.1.1 series. This is also our Long Term Support (LTS) version, supported until 11th Se…

【物联网】Linux平台OpenSSL安装教程

00. 目录 文章目录 00. 目录01. OpenSSL概述02. OpenSSL下载03. OpenSSL安装04. 查看系统OpenSSL版本05. 附录 01. OpenSSL概述 OpenSSL是一个安全套接字层密码库,囊括主要的密码算法、常用密钥、证书封装管理功能及实现ssl协议。OpenSSL整个软件包大概可以分成三个…

OpenSSL安装使用(二):OpenSSL安装说明

注:该方法适用于Openssl 1.1.1及以上版本 1)安装环境:Windows10专业版VS2010 相关软件下载地址: 1)ActivePerl :Download & Install Perl - ActiveState 2)openssl:/source/…

OpenSSL安装

下载OpenSSL压缩包 下载地址 可以直接下载压缩包或者用Git拉取 下载perl 下载地址 下载压缩包,解压,将路径D:\Program\strawberry-perl\perl\bin配置到环境变量path中 打开powershell,输入perl -v 代表安装成功 下载nasm 下载地址 下载…

OpenSSL完整安装教程及部分问题解决

一、环境: 系统:Centos 7 OpenSSL版本:openssl-1.1.1g 二、下载 OpenSSL官方下载网址:https://www.openssl.org/source/ openssl有发行了2.0版本,但此处仅用稳定的1.0版本即可。 官方教程:https://wiki.…

Windows 下OpenSSL安装过程及错误解决办法

Windows下使用OpenSSL有两种方式: 一.直接下载别人编译好的安装包:http://slproweb.com/products/Win32OpenSSL.html 二.自己编译安装: 1.下载并安装perl http://www.activestate.com/activeperl/downloads/ 2.安装与配置: …

openssl安装与使用

1、OpenSSL简介 OpenSSL是一个SSL协议的开源实现,采用C语言作为开发语言,具备了跨平台的能力,支持Unix/Linux、Windows、Mac OS等多种平台。    OpenSSL最早的版本在1995年发布,1998年后开始由OpenSSL项目组维护和开发。当前最新…

windows 下openssl安装配置

一、下载 1、官网下载 /source/index.html(源码版) 2、网盘下载(windows版) 链接:https://pan.baidu.com/s/1JrM_Fg8uHt0O0HEN_w7coA 提取码:7777 3 、码客下载 OpenSSL官方下载 - 码客 …

Openssl安装教程

目录 1、安装相关依赖2、官网下载openssl版本3、编译openssl4、查看openssl版本 1、安装相关依赖 通过yum命令下载相关的依赖包gcc、libffi-devel、zlib*、openssl-devel,当然很多依赖包系统都应该有了; yum install gcc libffi-devel zlib* openssl-d…

降维分析之PCA分析及实现

引言 不知道大家还记不记得前面我们分享 支持向量机(SVM)的分析及python实现时说过,当数据遇到线性不可分时,我们可以利用kernel技巧将低维数据映射到高维数据上,从而使得数据线性可分,这是个“升维”操作。那么本章我…

[R语言] R语言PCA分析教程 Principal Component Methods in R

R语言PCA分析教程 Principal Component Methods in R(代码下载) 主成分分析Principal Component Methods(PCA)允许我们总结和可视化包含由多个相互关联的定量变量描述的个体/观察的数据集中的信息。每个变量都可以视为不同的维度。如果数据集中包含3个以…

R语言对表达谱样本做PCA分析

主成分分析(Principal component analysis, PCA)是一种数学算法,它可以在减少数据维度的同时,保留数据集中绝大多数的变量[1]。 PCA通过对主成分进行辨别,找出一个方向,并沿此方向分布的数据为最大值,从而减少数据维度。通过采用这样的主成分,便可以只选用若干变量而不…

SIMCA-P 11.5 使用教程 PCA分析 PLS-DA分析

软件:SIMCA-P 11.5 数据:一个公共生物数据,195个样本(1类样本48例,2类样本147例),22个特征 二维数据表,csv格式,第一行为类标,第一列为特征编号 1、读取数据文件 (1)"File" -> "New" -> 选择csv数据文件,跳转Text Import Wizard窗口…