Ubuntu20安装Python 3.9
sudo apt update
sudo apt upgrade
sudo apt install build-essential libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev libssl-dev
wget https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tgz
tar -xf Python-3.9.13.tgz
cd Python-3.9.13
./configure --enable-optimizations
make -j 4
sudo make altinstall
apt install python3-pip
apt install pip3
设置及修改默认python版本
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3.9 1
sudo update-alternatives --config python
设置及修改默认python3版本
sudo update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.9 1
sudo update-alternatives --config python3
python3软连接
sudo ln -s /usr/bin/python3 /usr/bin/python
- 上一篇: Centos8安装Python3.9
- 下一篇: linux后台执行python脚本
猜你喜欢
- 2024-01-08python脚本检测出现指定标题窗口并点击鼠标
- 2024-01-08python推送钉钉群消息
- 2024-01-04linux后台执行python脚本
- 搜索