共计 661 个字符,预计需要花费 2 分钟才能阅读完成。
提醒:本文最后更新于2022-10-12 21:57,文中所关联的信息可能已发生改变,请知悉!
安装环境依赖
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 gcc libffi-devel
下载安装包
官网:Download Python | Python.org
最新包:https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tgz
wget https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tgz
解压
tar -zxvf Python-3.10.4.tgz
安装
cd Python-3.10.4
./configure --prefix=/usr/local/python3
make && make install
建立软连接
如果之前有下载过系统的,需要提前删除之前的软连接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
检查Python3及pip3是否正常可用
python3 -V
pip3 -V
分别显示
Python 3.10.4
pip 22.1.1 from /usr/local/python3/lib/python3.10/site-packages/pip (python 3.10)
正文完
哇塞