Getting Started

Installing Python

Learn how to install Python on different operating systems and run your first simple Python program from the command line.

Installing Python

To begin writing Python code, you’ll need to install the Python interpreter.

Windows

  1. Visit python.org/downloads

  2. Download the latest version for Windows.

  3. Run the installer and check the box that says Add Python to PATH.

  4. Click “Install Now.”

macOS

  • Use Homebrew:

    bashCopyEditbrew install python
  • Or download the installer from python.org.

Linux

Use your system’s package manager:

bashCopyEditsudo apt install python3  # Debian/Ubuntu
sudo dnf install python3  # Fedora

Verifying the Installation

Open a terminal or command prompt and run:

bashCopyEditpython --version
# or
python3 --version

You should see the installed Python version.

Running Your First Script

  1. Open a text editor and write this code:

pythonCopyEditprint("Hello, world!")
  1. Save the file as hello.py.

  2. Run the file from the terminal:

bashCopyEditpython hello.py
# or
python3 hello.py

You should see:

CopyEditHello, world

Congratulations! You've run your first Python program.

Installing Python

To begin writing Python code, you’ll need to install the Python interpreter.

Windows

  1. Visit python.org/downloads

  2. Download the latest version for Windows.

  3. Run the installer and check the box that says Add Python to PATH.

  4. Click “Install Now.”

macOS

  • Use Homebrew:

    bashCopyEditbrew install python
  • Or download the installer from python.org.

Linux

Use your system’s package manager:

bashCopyEditsudo apt install python3  # Debian/Ubuntu
sudo dnf install python3  # Fedora

Verifying the Installation

Open a terminal or command prompt and run:

bashCopyEditpython --version
# or
python3 --version

You should see the installed Python version.

Running Your First Script

  1. Open a text editor and write this code:

pythonCopyEditprint("Hello, world!")
  1. Save the file as hello.py.

  2. Run the file from the terminal:

bashCopyEditpython hello.py
# or
python3 hello.py

You should see:

CopyEditHello, world

Congratulations! You've run your first Python program.

Installing Python

To begin writing Python code, you’ll need to install the Python interpreter.

Windows

  1. Visit python.org/downloads

  2. Download the latest version for Windows.

  3. Run the installer and check the box that says Add Python to PATH.

  4. Click “Install Now.”

macOS

  • Use Homebrew:

    bashCopyEditbrew install python
  • Or download the installer from python.org.

Linux

Use your system’s package manager:

bashCopyEditsudo apt install python3  # Debian/Ubuntu
sudo dnf install python3  # Fedora

Verifying the Installation

Open a terminal or command prompt and run:

bashCopyEditpython --version
# or
python3 --version

You should see the installed Python version.

Running Your First Script

  1. Open a text editor and write this code:

pythonCopyEditprint("Hello, world!")
  1. Save the file as hello.py.

  2. Run the file from the terminal:

bashCopyEditpython hello.py
# or
python3 hello.py

You should see:

CopyEditHello, world

Congratulations! You've run your first Python program.

© Layer Docs

Made by Alejandro · Powered by Framer

Create a free website with Framer, the website builder loved by startups, designers and agencies.