升级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)
相关推荐
PHP实战开发录37 分钟前
PHP脚本手动能跑定时任务却失败
开发语言·php·开发
郝学胜-神的一滴2 小时前
Effective Python 条款 10 :海象运算符_=
开发语言·python·程序人生·开源
wuyk5552 小时前
Python零基础入门第十四章:异常处理(try-except)
开发语言·python
2601_962078192 小时前
Appium+Python+pytest自动化测试框架详解
自动化测试·python·appium·pytest·移动应用
wuyk5552 小时前
【Socket 进阶之路】第 3 章 TCP 三次握手 & 四次挥手深度剖析|连接建立、断开、状态机、TIME_WAIT 核心工程问题
服务器·开发语言·网络·物联网·网络协议·tcp/ip
卷无止境5 小时前
智能体开发环境ADE浅析,编程工具的下一次范式跃迁
后端·python
彧azz7 小时前
图的存储结构详解:邻接矩阵的原理、实现与应用
开发语言·数据结构·学习·php
嵌入式学习菌8 小时前
Modbus‑RTU 数据类型分析
开发语言·单片机·bug
matlab代码9 小时前
基于matlab数字图像处理的指纹识别系统【源码68期】
开发语言·matlab
2601_962300819 小时前
机器学习贴士:使用Python编写MapReduce
hadoop·python·机器学习·mapreduce·数据处理