pyenv
pyenv is a command-line tool for managing multiple Python versions. It lets you install and switch between interpreters per user and per project.
Installation and Setup
Install pyenv and add set it up in your shell startup file:
Verify the installation:
$ pyenv --version
Key Features
- Installs multiple Python versions from different implementations, such as CPython and PyPy.
- Uses lightweight shims so the selected version is used for
pythonand related tools on yourPATH. - Supports global, local, and shell scoped versions and writes a
.python-versionfile for projects. - Allows the creation and management of virtual environments with the pyenv-virtualenv plugin.
- Keeps user-level installs separate from system Python for safer experimentation.
Usage
List available versions and install one:
$ pyenv install -l
$ pyenv install 3.14.0
Show installed versions and pick a default:
$ pyenv versions
$ pyenv global 3.14.0
$ python --version
Python 3.14.0
Pin a project to a specific interpreter and record it in .python-version:
$ cd project_dir/
$ pyenv local 3.14.0
Use a version only for the current shell session:
$ pyenv shell 3.14.0
Locate the active interpreter and confirm which shim is used:
$ pyenv which python
Update to newer releases:
$ pyenv update
Remove versions you no longer need and reclaim space:
$ pyenv uninstall 3.10.1
Related Resources
Tutorial
Managing Multiple Python Versions With pyenv
Learn how to use pyenv to manage multiple Python versions, prevent conflicts, and keep your projects compatible and development smooth.
For additional information on related topics, take a look at the following resources:
By Leodanis Pozo Ramos • Updated Nov. 28, 2025