在 Ubuntu 上装 Python 通常是用命令的,而且大多数情况系统已经自带了 Python。
python3 --version
如果输出版本号(比如 Python 3.10.12),说明已经装好了。
sudo apt update
sudo apt install python3
如果你还需要 pip(装第三方库用):
sudo apt install python3-pip
Ubuntu 默认源里版本有限,可以用 deadsnakes PPA:
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.11
Ubuntu 装 Python 基本都是用命令的,最常用就是:
sudo apt install python3 python3-pip
如果你是刚装系统 / 服务器 / 桌面版,可以告诉我,我可以按你的场景一步步教你。