安装python3编程环境
检查是否安装python3
python3 -V
安装python3依赖
sudo yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
下载python3资源包
wget + 相应资源连接
官网:Python Release Python 3.10.12 | Python.org
自己选择相应版本,建议最新版往下一个版
解压资源包
tar -zxvf Python-3.10.12.tgz
安装python3
配置安装路径/usr/local/python3.10
cd Python-3.10.12
./configure prefix=/usr/local/python3.10
编译安装python3
make && make install
- 添加软链接,让python3和pip3这两个命令指向刚刚安装的python3.10
sudo ln -s /usr/local/python3.10/bin/python3.10 /usr/bin/python3
sudo ln -s /usr/local/python3.10/bin/pip3.10 /usr/bin/pip3
检验python3安装是否正确
python3 -V
- 输入以下命令,检查pip3是否也被正确安装
pip3 -v
pip的升级
pip3 install --upgrade pip
pip install --upgrade pip
标签:python3.10,12,Python,devel,usr,Linux,安装,python3
From: https://blog.csdn.net/l47ronin/article/details/139584176