Deepin UOS Linux 编译安装升级 python3,
Deepin UOS Linux 安装升级 python3
下载编译安装
sudo apt -y install wget
wget https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tar.xz
tar -xvf Python-3.11.0.tar.xz
cd Python-3.11.0/
sudo ./configure --prefix=/opt/python3 --enable-optimizations
# sudo ./configure --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
评论暂时关闭