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

相关推荐
金銀銅鐵16 小时前
[Python] 从《千字文》中随机挑选汉字
后端·python
cup1121 小时前
[技术复盘] Windows Python 打包实战:Nuitka 环境踩坑总结与 CI 自动化构建全指南
python·ai·环境变量·ci·nuitka·skill
aqi001 天前
15天学会AI应用开发(七)有了大模型为什么还要引入RAG
人工智能·python·大模型·ai编程·ai应用
金銀銅鐵1 天前
用 Python 实现 Take-Away 游戏
python·游戏
copyer_xyf1 天前
Agent 流程编排
后端·python·agent
copyer_xyf1 天前
Agent RAG
后端·python·agent
copyer_xyf1 天前
【RAG】向量数据库:milvus
后端·python·agent
copyer_xyf1 天前
Agent 记忆管理
后端·python·agent
星云穿梭2 天前
用Python写一个带图形界面的学生管理系统——完整教程
python