Skip to content

How to Install Python (and Which Method to Choose)

Use uv to install Python. Install uv once, and it downloads Python for you, keeps each project on the version it needs, and never touches the Python your operating system depends on. It works the same way on macOS, Windows, and Linux.

Tip

Short on time? Install uv, then run uv python install. That gets you a current, project-ready Python without admin rights. The rest of this page explains the alternatives and when they make sense.

Install Python on your machine

First install uv, then let it fetch Python. Open a terminal and run the commands for your operating system.

curl -LsSf https://astral.sh/uv/install.sh | sh

Restart your terminal so uv is on your PATH, then install the latest Python:

uv python install

uv downloads about 24 MB the first time and prints a confirmation like Installed Python 3.14.6 in 800ms. No sudo or admin shell is required, because the interpreter lands in a user-owned directory. For alternative uv installers (Homebrew, WinGet, Scoop), signature verification, and version-specific commands, see how to install uv and how to install Python with uv.

Confirm Python runs

Check that Python works through uv:

$ uv run python --version
Python 3.14.4

If you see a version number, Python is installed and uv can find it.

Why doesn’t python work on its own?

uv installs Python for project use, so the command to run it is uv run python, not a bare python. uv run python always uses the version the current project pins, which is why this handbook leans on it instead of a global command.

A plain uv python install adds versioned commands like python3.13 to your PATH, but it does not create an unversioned python. Typing python right after installing may find nothing, or silently run a different Python your system already had.

To get a global python command anyway, install one explicitly:

$ uv python install --default

That adds python and python3 next to the versioned executables. The --default flag is experimental. For the full walkthrough see how to add Python to your system PATH with uv, and if python still reports command not found, see how to fix “command not found: python” on macOS.

Start a project, not a bare interpreter

Most of the time you don’t want a loose python command; you want a project. In an empty folder, run:

$ uv init --name myproject
Initialized project `myproject`
$ uv run python -c "import sys; print(sys.version.split()[0])"
Using CPython 3.14.4
Creating virtual environment at: .venv
3.14.4

uv init writes a pyproject.toml, and the first uv run installs Python if needed, creates a .venv virtual environment, and runs your code inside it. The tutorial Getting started with uv walks through this from scratch. If you only run one-off scripts and don’t want a project, see do I need a project to use uv?.

What does “installing Python” actually involve?

Putting an interpreter on disk is only the first of three separate jobs:

  • Install the interpreter. Get a Python runtime onto your machine (this page).
  • Create a virtual environment. Give each project its own isolated space so packages never collide.
  • Manage dependencies. Declare the libraries a project needs and record exact versions for reproducibility.

Older setups stitch these together from separate tools: python.org or pyenv for the interpreter, venv for the environment, pip for dependencies. uv does all three. uv python install handles the interpreter, and uv init plus uv run create the environment and install dependencies for you. That single tool is why the handbook recommends starting with uv.

Pick a different installer only if you have a reason

You’ll run into other ways to get Python. Each has a narrow case where it fits.

  • python.org installer. The reference CPython build, downloaded from python.org. Reasonable if you want one Python and will manage environments and dependencies yourself. It won’t switch versions per project.
  • Python Install Manager / Microsoft Store (Windows). python.org’s Python Install Manager (the py command) installs and switches Windows versions, and the Microsoft Store package is a one-click alternative. Fine for a first Python on Windows, but neither manages your project’s dependencies.
  • Homebrew (macOS/Linux). brew install python exists to satisfy other Homebrew formulae, and brew upgrade can bump the version out from under you. Use it for a throwaway python3, not project work; see should I use Homebrew to install Python?.
  • pyenv. pyenv builds versions from source for side-by-side use. A solid pre-uv choice, but uv does the same job without a compiler toolchain; see how pyenv and uv compare.
  • Anaconda / conda. Choose it when you need conda-only packages such as CUDA, GDAL, or HDF5, or a batteries-included data-science stack. Otherwise it is heavier than the job needs; see which package manager should I use?.

Whichever you pick, avoid building projects on the system Python that ships with macOS and Linux. It exists for the operating system, ships one aging version, and breaks OS tools when you install packages into it.

Frequently asked questions

How do I install Python?

Install uv, then run uv python install. uv downloads a prebuilt CPython without admin rights and works the same way on macOS, Windows, and Linux. You can skip the explicit step too: uv downloads Python the first time you run a project.

Which Python should I use?

Use the latest stable CPython, installed and managed by uv rather than the Python your operating system ships. A uv-managed interpreter stays separate from the system one, so upgrades never break OS tools and each project can pin its own version.

Do I need to install Python separately before using uv?

No. uv downloads and manages Python for you, so installing uv is enough to get started. Running uv init then uv run in a new folder installs a version, creates a virtual environment, and runs your code in one step.

Learn More

Last updated on