Learn Python
>>> getting_started.install

Installing Python & Setting Up the Environment

#concept

Before you can run any Python code, Python itself needs to be installed on your machine — it isn't built into most operating systems the way a text editor is. The official installer comes from python.org and works on Windows, macOS, and Linux, though many Linux distributions and Macs already ship with some version of Python pre-installed.

Once installed, you interact with Python through a terminal (Command Prompt or PowerShell on Windows, Terminal on macOS/Linux). Typing python or python3 followed by --version confirms the install worked and tells you exactly which version you're running — worth checking, since Python 2 and Python 3 are different enough that code written for one often won't run on the other.

#how it works
1

Download the installer

Go to python.org/downloads and grab the installer for your operating system — it detects your OS automatically and offers the latest stable release.

2

Run it, and watch for one checkbox

On Windows specifically, the installer shows a checkbox for "Add python.exe to PATH" — tick it. Skipping this is the single most common reason typing python in a terminal later does nothing.

3

Verify the install

Open a terminal and type python --version (or python3 --version on macOS/Linux). Seeing a version number back confirms everything worked.

4

Pick an editor

Any text editor works, but something built for code — VS Code, PyCharm, or even a simple editor with Python syntax highlighting — makes reading indentation and errors much easier.

5

You're ready to run real files

With Python installed and an editor open, you can now save .py files and run them from the terminal — covered next.

#example
python3 --version
Output
Python 3.12.4
1Typing this in a terminal asks the operating system to run the python3 program with the --version flag.
2Python responds by printing its own version and exiting immediately — the fastest way to confirm an install worked and to see exactly which version you're on.
#use cases
A plain python.org install — the standard choice for learning and most general-purpose scripting
Anaconda or Miniconda — popular alternative distributions that bundle data-science libraries (NumPy, pandas) alongside Python itself
pyenv or a similar version manager, for switching between multiple Python versions on one machine
A Docker container, when you need a fully isolated, reproducible environment across different machines
An online REPL like Replit or Google Colab, for trying Python with zero local setup

Recommended resourcesAffiliate links · may earn us a commission

Recommended for learners

Structured coding coursesVideo courses that pair well with visual practice — pick one language and go deep.Browse courses Pro code editor & AI assistantWrite, debug and explain code faster while you practice the patterns here.Try it free Classic DSA interview booksThe reference books interviewers themselves learned from — great next to the visualizers.See the books

Practice what you learned

Re-implement each visualized algorithm in Python yourself — building beats watching.