
pyenv
A command-line tool for installing and switching between multiple Python versions.
- Stars
- 45.2k
- Forks
- 3.3k
- Licence
- MIT
- Language
- Shell
- Last update
- 5 days ago
- Type
- Dev tool
What it is
pyenv is a command-line tool that lets you install several versions of Python on one computer and switch between them. You can set a global default for your user account, set a different version per project, or override it with an environment variable. It is built from shell scripts and works by placing a directory of small wrapper programs called shims on your PATH.
- Install a specific Python version with pyenv install
- Set a global default Python version for your user account
- Pin a particular Python version for a single project directory
- Run commands against several Python versions in turn, for example to test a library across versions
Great for
- Developers who work on several Python projects that need different Python versions
- People testing code across multiple Python versions, for example with tox
- Linux and macOS users who want a per-user Python setup without touching system Python
Not ideal for
- Windows users, since the README says pyenv does not officially support Windows outside WSL; the maintainers point to pyenv-win instead
- People who want pyenv to also manage virtual environments, since the README says it does not do that; pyenv-virtualenv is a separate project
- Users who need native Windows Python builds, because the Pythons pyenv installs under WSL are Linux builds
How to get it
- 1
Download the app
You'll need: A Unix-like system such as Linux or macOS, or WSL on Windows · git, if you use the GitHub checkout method
Automatic installer (recommended, Linux/Unix)
curl -fsSL https://pyenv.run | bashInstall via Homebrew (macOS)
brew install pyenvBasic GitHub checkout
git clone https://github.com/pyenv/pyenv.git ~/.pyenv - 2
Run it
- Install pyenv using the installer, Homebrew, or a git checkout
- Add the shell setup code by running pyenv init --install, or follow the manual Bash or Zsh instructions in the README
- Restart your shell with exec "$SHELL"
- Install a Python version with pyenv install, then switch to it with pyenv global or pyenv local
- 3
Get the most out of it
- Use pyenv local to set a version per project directory so each project picks its own Python
- Use the environment variable override to change the version for a single command or session
- Install the build dependencies listed in the README wiki before installing new Python versions
- Use pyenv-virtualenv, which the README links to, if you want virtual environment management
Downloads
Strengths
- Simple, single-purpose design that follows the UNIX tradition, according to the README
- Written in pure shell scripts, so it does not depend on an existing Python install
- Supports several Python distributions, including CPython, PyPy, and Stackless Python
Trade-offs
- Installing a Python version can require build dependencies, which the README covers in a separate wiki page
- Shell setup is needed so the shims and PATH changes take effect, and the README gives different steps for Bash and other shells
- No native Windows support; Windows users must use WSL or a fork
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| pyenv (this) | 45.2k | Dev tool | intermediate | 5 days ago | Developers who work on several Python projects that need different Python versions |
| asdf | 25.6k | Dev tool | beginner | 5 days ago | Developers who work on several projects that need different language versions |
| ohmyzsh | 190k | Dev tool | beginner | 4 days ago | People who already use zsh and want a ready-made configuration without writing it from scratch |
| nvm | 95.7k | Dev tool | beginner | 8 days ago | Developers who work on several Node.js projects that need different versions |
| nushell | 40.8k | Dev tool | intermediate | 5 days ago | Developers who work a lot in the terminal and want to query files, processes, or config files as data |
| zoxide | 40.4k | Dev tool | beginner | 4 days ago | Developers who move between many project folders in a terminal |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.