Python for AIPython for AI
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 --version

If 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-venv

Install build tools

bash
sudo apt install python3-dev build-essential

Verify installation

Check that Python and pip are installed:

bash
python3 --version
pip3 --version

You should see version numbers for both.

Test Python

  1. Start Python:
bash
python3
  1. 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.
>>>
  1. Try a simple command:
python
print("Hello from Linux!")
  1. Exit Python:
    • Type exit() or press Ctrl + D

Troubleshooting

Continue to VS Code introduction
Install and configure Visual Studio Code