升级Python到3.11

文章目录

升级Python到3.11

python官网:https://www.python.org/

python3.11下载地址:https://www.python.org/ftp/python/3.11.14/Python-3.11.14.tar.xz

编译安装python3.11

shell 复制代码
#1.安装编译依赖
yum install -y gcc openssl-devel bzip2-devel libffi-devel zlib-devel
#2.下载Python3.11并解压
tar xf Python-3.11.14.tar.xz
cd Python-3.11.14/
#3.进入编译目录,编译安装-配置,生成Makefile
./configure --enable-optimizations --with-ssl
#--enable-optimizations自动进行优化(python)
#--with-ssl支持ssl模块,功能。

#4.编译,根据Makefile文件检查依赖环境,进行构建应用程序
make -j `nproc`
#5.安装  复制文件到对应路径
make install 

升级pip,安装ansible

shell 复制代码
#1.升级pip
python3 -m pip install -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple --upgrade pip

#2.pip源(加速pip下载软件)
pip3 config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple

#3.安装ans
pip3 install  ansible

#4.查看ansible版本
[root@m01 ~]# ansible --version
ansible [core 2.19.4]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.11/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.11.14 (main, Nov 17 2025, 09:04:45) [GCC 7.3.0] (/usr/local/bin/python3)
  jinja version = 3.1.6
  pyyaml version = 6.0.3 (with libyaml v0.2.5)
相关推荐
FishCoderh24 分钟前
Python自动化办公实战:批量重命名文件,告别手动操作
python
躺平大鹅27 分钟前
Python函数入门详解(定义+调用+参数)
python
曲幽2 小时前
我用FastAPI接ollama大模型,差点被asyncio整崩溃(附对话窗口实战)
python·fastapi·web·async·httpx·asyncio·ollama
两万五千个小时5 小时前
落地实现 Anthropic Multi-Agent Research System
人工智能·python·架构
哈里谢顿7 小时前
Python 高并发服务限流终极方案:从原理到生产落地(2026 实战指南)
python
用户8356290780511 天前
无需 Office:Python 批量转换 PPT 为图片
后端·python
markfeng81 天前
Python+Django+H5+MySQL项目搭建
python·django
GinoWi1 天前
Chapter 2 - Python中的变量和简单的数据类型
python
JordanHaidee1 天前
Python 中 `if x:` 到底在判断什么?
后端·python
ServBay1 天前
10分钟彻底终结冗长代码,Python f-string 让你重获编程自由
后端·python