最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
ubuntu上如何查看python是否安装成功
时间:2026-07-23 09:06:48 编辑:袖梨 来源:一聚教程网
在 Ubuntu 上检查 Python 是否安装成功,可以通过以下步骤进行:

打开终端(快捷键
Ctrl + Alt + T)。输入以下命令来检查 Python 的版本:
python --version或者,如果你想检查 Python 3 的版本,可以使用:
python3 --version按下回车键后,如果 Python 已经安装,你将看到类似如下的输出:
Python 3.8.10这表示 Python 3.8.10 已经安装在你的系统上。如果显示的是其他版本号,说明你安装的 Python 版本可能不同。
如果你没有安装 Python,或者想要安装特定版本的 Python,你可以使用 Ubuntu 的包管理器
apt来安装。例如,要安装 Python 3,可以使用以下命令:sudo apt updatesudo apt install python3安装完成后,再次运行
python3 --version命令来确认 Python 3 是否已经成功安装。
请注意,Ubuntu 系统通常默认安装 Python 2 和 Python 3。Python 2 已经在 2020 年 1 月 1 日停止支持,因此建议使用 Python 3。