centos 编译安装 python 和 openssl

安装环境:

centos 7.9 : python 3.10.5 和 openssl 3.0.12

centos 6.10 : python 3.10.5 和 openssl 1.1.1

两个环境都能安装成功,可以正常使用。

安装 openssl

下载地址

下载后解压,进入到解压目录

执行:

shell 复制代码
./Configure --prefix=/usr/local/openssl3.2.0
make && make install

配置环境变量

python 安装的时候要找到库

shell 复制代码
export LD_LIBRARY_PATH=/usr/local/openssl3.2.0/lib:$LD_LIBRARY_PATH

终端输入 openssl version 查看 openssl 版本

安装 Python

安装依赖

shell 复制代码
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel

下载python3.10.5

shell 复制代码
wget https://www.python.org/ftp/python/3.10.5/Python-3.10.5.tar.xz

解压、编译、安装

shell 复制代码
tar -xvf Python-3.10.5.tar.xz

cd Python-3.10.5

./configure --prefix=/usr/local/python3

make && make install

配置软链接

shell 复制代码
ln -s /usr/local/python3.10.5/bin/python3.10 /usr/bin/python3
ln -s /usr/local/python3.10.5/bin/pip3.10 /usr/bin/pip3

安装完成,现在可以用 python3.10.5, 并且可以用 pip

相关推荐
小九九的爸爸22 分钟前
前端想要入门Agent开发,要具备哪些Python基础?
python·agent·ai编程
阿耶同学1 小时前
手把手教你用 LangGraph 搭建三层嵌套 Agent 架构
python·程序员
花酒锄作田18 小时前
Pydantic校验配置文件
python
hboot18 小时前
AI工程师第四课 - 深度学习入门
pytorch·python·神经网络
ZhengEnCi1 天前
P2M-Matplotlib折线图完全指南-从数据可视化到趋势分析的Python绘图利器
python·matlab·数据可视化
ZhengEnCi1 天前
P2L-Matplotlib饼图完全指南-从数据可视化到图表定制的Python绘图利器
python·matlab
曲幽1 天前
你的REST接口还在“过度投喂”数据吗?——FastAPI + GraphQL实战避坑指南
python·fastapi·web·graphql·route·cors·rest·strawberry
用户8358086187911 天前
基于 Self-RAG 与列表级重排序的进阶 RAG 系统设计与实现
python
Warson_L2 天前
Python `Annotated` 与 LangGraph Reducer 学习笔记
python
韩师傅2 天前
海天线算法的前世今生
python·计算机视觉