Installing Python
How to install and manage multiple versions of Pythons.
| Method | Linux | macOS | Windows |
|---|---|---|---|
| pyenv | ✅ | ✅ | ✅ |
| Homebrew | ✅ | ✅ | ❌ |
| Deadsnakes | ✅ | ❌ | ❌ |
| Windows Store | ❌ | ❌ | ✅ |
pyenv
- Install and managed multiple versions of Python on the same machine.
- Control python version in global, local, and shell levels.
- 👍🏻 Written in shell script, does not require pre-existed Python installation.
- 👎🏻 Use shims to inject the correct Python version into your shell.
- Does not support Windows natively, but there's pyenv-win/pyenv-win.
Homebrew
Homebrew can install multiple versions of Python, e.g.
brew install python@3.12
warning
Homebrew pythons exists to serve other formulas. Always use virtual environment and do not install other packages into Homebrew Python.
Deadsnakes PPA
Deadsnakes team maintains a PPA for Ubuntu and other Debian-based distributions, providing newer Python versions than the default repositories.
Windows Store
Windows Store offers multiple versions of Python.