源码编译安装
1.到官网下载需要的版本,下载地址:https://www.python.org/ftp/python/
wget https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tgz
2.源码解压
tar -zxvf Python-3.9.9.tgz
3.依赖安装
apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
4.编译安装
cd Python-3.9.9
./configure --prefix=/usr/local/pyhton3.9
make & make install
5.创建系统命令(软连接)
sudo ln -s /usr/local/pyhton3.9/bin/pyhton3.9 /usr/bin/python
网友评论