Getting Started
Install on Linux
Installing Python on Linux distributions
Check existing Python
Most Linux distributions come with Python pre-installed. Let's check:
bash
python3 --versionIf you see a recent Python 3 version, you're ready! Most modern Linux distributions include Python 3.
Linux uses
python3 to distinguish from the older Python 2. Some distributions let you use just python, but python3 always works.Install or update Python
Choose your Linux distribution below:
Install Python and pip
bash
sudo apt update
sudo apt install python3 python3-pip python3-venvInstall build tools
bash
sudo apt install python3-dev build-essentialVerify installation
Check that Python and pip are installed:
bash
python3 --version
pip3 --versionYou should see version numbers for both.
Test Python
- Start Python:
bash
python3- You'll see the Python prompt:
bash
Python 3.13.5 (main, Jul 29 2025, 12:03:01) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>- Try a simple command:
python
print("Hello from Linux!")- Exit Python:
- Type
exit()or pressCtrl + D
- Type
Troubleshooting
Continue to VS Code introduction
Install and configure Visual Studio Code