4Geeks chosen to deliver AI education in the Bahamas alongside Harvard, Oxford, and Columbia.See more

How to install Python?

By 4Geeks

Install Python 3.15 on Windows, macOS or Linux, check that it works and create your first virtual environment.

8 min readLast updated
Install Python icon

How to install Python

Short answer: On Windows, install the Python install manager from python.org or the Microsoft Store and run py install 3.15 in PowerShell. On macOS, use the .pkg installer from python.org or brew install python@3.15. On Linux, Python usually comes preinstalled: add what is missing with sudo apt install python3 python3-venv python3-pip on Ubuntu and Debian, or sudo dnf install python3 on Fedora. The latest version is Python 3.15.2, released on October 25, 2026. Check it in a new terminal with python --version on Windows or python3 --version on macOS and Linux.

Python is free and works the same on all three systems. What changes is how you install it and what the command is called: python and py on Windows, python3 on macOS and Linux.

On Windows, the Python install manager installs Python with a single command. Open a new terminal before you check the version, so it recognizes the python command.

Installing Python at a glance

SystemRecommended wayCommandCheck it
Windows 10 and 11Python install managerpy install 3.15python --version
macOSpython.org installerOpen the .pkg filepython3 --version
macOS with HomebrewHomebrewbrew install python@3.15python3.15 --version
Ubuntu and Debianaptsudo apt install python3 python3-venv python3-pippython3 --version
Fedoradnfsudo dnf install python3python3 --version
Any systemuvuv python install 3.15uv python list

Before you start: do you already have Python?

Open a terminal and ask for the version:

bash
python --version    # Windows
python3 --version   # macOS and Linux

If it answers with a number, such as Python 3.15.2, you already have it. If your version is old, follow the guide to update Python. If Windows shows Python was not found; run without arguments to install from the Microsoft Store, Python is not installed: that message comes from a Windows shortcut, and the fix is in the errors section.

Install Python on Windows

python.org recommends the Python install manager, which installs, updates and removes versions with the py command. Open PowerShell or Windows Terminal and run:

powershell
winget install 9NQ7512CXL7T -e --accept-package-agreements --disable-interactivity
py install 3.15
py list

You can also install the Python install manager from the Microsoft Store or from python.org/downloads. Close the terminal, open a new one and check the result:

powershell
python --version
py list

py list shows every installed version. If you install another one later, py -V:3.15 runs exactly 3.15.

With the classic installer: at python.org/downloads/windows, download the 64-bit Windows installer, or ARM64 if your computer has an ARM processor. On the first screen, check Add python.exe to PATH and click Install Now. If you forgot to check it, run the installer again, choose Modify and enable Add Python to environment variables.

Install Python on macOS

macOS may come with a python3 from Apple's command line tools, usually an old version. Do not delete it: install the new version next to it.

With the python.org installer: download the macOS installer from python.org/downloads/macos, open the .pkg file and follow the steps. When it finishes, open the Python 3.15 folder in Applications and double-click Install Certificates.command, so Python can download packages over HTTPS. Check the install in a new Terminal window:

bash
python3 --version

With Homebrew:

bash
brew update
brew install python@3.15
python3.15 --version

Homebrew installs the new version as python3.15. The python3 command may still point to another version, so call the new one by its full name or create a virtual environment with it.

Install Python on Linux

Almost every distribution ships Python 3 because its own tools use it. On Ubuntu and Debian, also install venv and pip, which are not always included:

bash
sudo apt update
sudo apt install python3 python3-venv python3-pip
python3 --version

If you need 3.15 and your Ubuntu release ships another version, use the deadsnakes PPA:

bash
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.15 python3.15-venv
python3.15 --version

On Fedora, use sudo dnf install python3, and on Arch, sudo pacman -S python. Do not change what python3 points to with update-alternatives or a symlink: your system uses it for its own tools, and you can break them.

Career · AI Engineering

You have Python, now build something with it

From zero to junior AI Engineer: Python, AI agents and RAG with mentors and real projects.

Check that Python works

With the version confirmed, also test pip, the package installer, and write your first program:

bash
python -m pip --version      # on macOS and Linux: python3 -m pip --version

Create a file called hello.py with this line:

python
print("Hello, Python")

And run it from the folder where you saved it:

bash
python hello.py              # on macOS and Linux: python3 hello.py

If you type only python or python3, the interactive console opens with the >>> prompt. Leave it with exit(), or read how to exit Python in the terminal.

Create a virtual environment for your projects

A virtual environment is a folder with its own Python and its own packages. Each project keeps its own versions and you never touch the system Python. Create it inside your project folder:

On Windows, in PowerShell:

powershell
python -m venv .venv
.venv\Scripts\activate
python -m pip install requests

On macOS and Linux:

bash
python3 -m venv .venv
source .venv/bin/activate
python -m pip install requests

With the environment active, python and pip belong to the project, and (.venv) appears at the start of the terminal line. To leave it, type deactivate.

If PowerShell says that running scripts is disabled on this system, allow local scripts for your user with Set-ExecutionPolicy -Scope CurrentUser RemoteSigned and activate the environment again.

Install Python with help from AI

An assistant such as ChatGPT, Claude or GitHub Copilot fixes install errors quickly when you give it the full context: your system, the command you ran and the exact message. These three prompts are ready to copy.

1. Choose how to install it

I want to install Python 3.15 on [Windows 11 / macOS 15 / Ubuntu 24.04].
I will use it for [learning to code / data analysis / building AI apps].
Tell me which method you recommend, the exact commands and how to check that it works.

2. Fix an install error

I am installing Python on [system] and when I run [paste the command] I get this error:
[paste the full message]
This is what [where.exe python / which -a python3] shows: [paste the output]
Explain the cause and give me the steps to fix it.

3. Set up your first project

I have Python 3.15 on [system]. Help me create a project in the folder [name]
with a virtual environment, install [requests / pandas / openai] and run a test script.
Give me the commands one by one and explain what each one does.

Before you run what it suggests, check that the commands are for your system. A Linux command does not work the same way in PowerShell.

Install Python with uv

uv is a tool that installs Python versions and manages projects and packages in a single program. If you already have it:

bash
uv python install 3.15
uv python list
uv venv --python 3.15

uv venv creates the .venv virtual environment with that version, even if your system has another one.

Learn with a mentor

Master Python, then build AI with it

In the 4Geeks AI Engineering career program you start with no experience and finish with AI agents and RAG systems in your portfolio.

Common errors when installing Python

What you seeWhy it happensFix
Python was not found; run without arguments to install from the Microsoft StoreWindows runs its own shortcut instead of PythonIn Settings > Apps > Advanced app settings > App execution aliases, turn off the aliases for python.exe and python3.exe, then install Python
'python' is not recognized as an internal or external commandPython is not on your PATHInstall it with the Python install manager, or repair the classic installer and enable Add Python to environment variables
zsh: command not found: python on macOSOn macOS the command is python3Use python3, or activate a virtual environment, where python exists
error: externally-managed-environment when you use pipUbuntu, Debian and Homebrew protect the system PythonCreate a virtual environment and install packages inside it
CERTIFICATE_VERIFY_FAILED when you download packages on macOSThe python.org installer's certificates are missingRun Install Certificates.command in the Python 3.15 folder in Applications
No module named pipYour Python came without pipRun python -m ensurepip --upgrade, or sudo apt install python3-pip on Ubuntu
Free download

Installing Python in a 2-page cheat sheet

The commands for Windows, macOS and Linux, how to check that it works, your first virtual environment, the most common errors and prompts for ChatGPT, Claude or Copilot. Free, in PDF.

How to install Python cheat sheet

2 pages · PDF · 4Geeks

  • The install commands for every system
  • Checks and your first virtual environment step by step
  • The 6 most common errors and prompts to fix them with AI

Get it free

Your PDF right away

Frequently asked questions about installing Python

Want to go from installing Python to building AI agents, with real projects and mentors?

See the AI Engineering program