Deepin UOS openEuler CentOS Linux 编译安装升级 python3
下载编译安装
sudo apt -y install wget
wget https://www.python.org/ftp/python/3.11.4/Python-3.11.4.tar.xz
tar -xvf Python-3.11.4.tar.xz
cd Python-3.11.4/
sudo ./configure --prefix=/opt/python3 --enable-optimizations
sudo make -j8
sudo make install -j8
修改环境变量
sudo deepin-editor /etc/profile
sudo vim /etc/profile
export PYTHON3_HOME=/opt/python3
export PATH=$PYTHON3_HOME/bin:$PATH
修改软连接指向
sudo ln -snf /opt/python3/bin/python3 /usr/bin/python3
升级pip
python3 -m pip install --upgrade pip
pip3 install --upgrade setuptools