Pyenv installs multiple Python interpreters and selects global, directory-local, or shell-specific versions. It uses PATH shims instead of loading into the shell.
Overview
Pyenv lets developers switch among many Python versions on one machine. It supports CPython, PyPy, Stackless Python, Jython, and other distributions, with installs driven from shell scripts rather than needing Python to bootstrap itself.
Version choice can be global per user, local to a project directory, or limited to the current shell session. An environment variable can override the active version, and multiple versions can be searched when resolving commands.
Installation paths include an automatic installer, Git checkout, or Homebrew on macOS. Windows is not officially supported outside WSL; a separate fork targets native Windows builds.
Plugins extend behavior, including virtualenv automation. Uninstalling or disabling pyenv removes shims from PATH so system Python resumes handling invocations.
Key features
- Install many Python distributions
- Global, local, and shell version pins
- PATH shim-based command routing
- Pure shell script implementation
- Prefix resolves to latest in line
- Plugin extension mechanism
Use cases
- Testing projects across Python versions
- Isolating legacy and modern interpreters
- Per-project interpreter pinning
- Running tox across multiple Pythons