Installation
Install Python locally and start the REPL
You do not strictly need to install anything to work through this course: every code block on every page runs in your browser with no setup required. That said, sooner or later you will want a local Python so you can run scripts, install third-party libraries, and integrate with your editor.
Picking a version
Always install the latest stable Python 3 (3.13 at the time of writing) unless a specific project pins you to an older version.
Python 2 is end-of-life
Python 2 reached end-of-life on January 1, 2020. No security patches, no bug fixes, and most libraries have dropped support. If you find Python 2 still installed on your system, it is there for legacy reasons only. Do not use it for new projects.
Which install method should you use?
Installing Python
Pick the option that matches your operating system.
macOS
The Python that ships with macOS is for the system, not for you. Use one of:
- python.org installer. Download from
python.org/downloads and run
the
.pkg. This is the simplest option for most users. - Homebrew.
brew install pythoninstalls the latest 3.x and addspython3andpip3to yourPATH. - pyenv.
brew install pyenvthenpyenv install 3.13.2. This lets you switch versions per project and is the gold standard for Python developers juggling multiple projects.
Why pyenv on macOS?
macOS ships with an old Python 2.7 (or a system-managed Python 3) that
you should never modify. pyenv installs Python versions in your home
directory and lets you switch between them with a single command:
pyenv global 3.13.2 or pyenv local 3.11.4 for a specific project.
Windows
- Download the installer from python.org/downloads.
- Check "Add python.exe to PATH" on the first screen of the
installer. This is the single most common gotcha. Without it, the
pythoncommand will not work from the terminal. - Alternatively, install from the Microsoft Store, which keeps Python updated automatically and handles the PATH for you.
Linux
Most distributions ship a recent Python in their package manager:
# Debian/Ubuntu
sudo apt install python3 python3-pip python3-venv
# Fedora
sudo dnf install python3 python3-pip
# Arch
sudo pacman -S python python-pipFor full version control, install pyenv and let it manage multiple
side-by-side interpreters:
# Install pyenv via its install script
curl https://pyenv.run | bash
# Add to your shell config (.bashrc, .zshrc, etc.)
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
# Install a Python version
pyenv install 3.13.2
pyenv global 3.13.2Verifying the install
Open a terminal and run:
python3 --version
pip3 --versionYou should see something like Python 3.13.2 and a matching pip
version. On Windows the commands are python and pip (without the
3 suffix).
If python3 is not found, the installer may not have added it to your
PATH. On Windows, re-run the installer and check the "Add to PATH" box.
On macOS/Linux, check that the install directory is in your $PATH.
The REPL
Running python3 with no arguments drops you into the REPL (read,
eval, print, loop), an interactive interpreter:
$ python3
Python 3.13.2 (main, ...) on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 2 + 2
4
>>> name = "Ada"
>>> f"Hello, {name}!"
'Hello, Ada!'
>>> exit()The REPL is perfect for exploring a library or testing one-liners. For
longer experiments, save your code to a file like script.py and run
it with python3 script.py.
Running code in the browser
Every executable block in this course runs in your browser — no setup required. This is powered by real Python 3.13 with NumPy, Pandas, Matplotlib, and Plotly preinstalled. Try it:
Test your knowledge
Which installation method is recommended if you need to manage multiple Python versions for different projects?
The python.org installer
pyenv
The Microsoft Store app
Copying python.exe into your project folder
What is the most common mistake when installing Python on Windows?
Downloading the 32-bit version instead of 64-bit
Installing Python 2 instead of Python 3
Forgetting to check "Add python.exe to PATH"
Installing to the wrong drive
What does REPL stand for?
Run, Execute, Print, Loop
Recursive Evaluation of Python Literals
Read, Eval, Print, Loop
Rapid Experimentation and Python Learning
Next: write your first program.