45,184
stars
+0
3,271
forks
387
watchers
1,429
prs
1,920
issues
174
releases
141
discussions
README
Simple Python Version Management: pyenv
pyenv lets you easily switch between multiple versions of Python. It's
simple, unobtrusive, and follows the UNIX tradition of single-purpose
tools that do one thing well.
This project was forked from rbenv and
ruby-build, and modified for Python.
What pyenv _does..._
Lets you change the global Python version on a per-user basis.
Provides support for per-project Python versions.
Supports multiple Python distributions: CPython, PyPy, Stackless Python, Jython, and more.
See the full list of available versions.
Allows you to override the Python version with an environment
variable.
Searches for commands from multiple versions of Python at a time.
This may be helpful to test across Python versions with tox.
In contrast with pythonbrew and pythonz, pyenv _does not..._
Depend on Python itself. pyenv was made from pure shell scripts.
There is no bootstrap problem of Python.
Need to be loaded into your shell. Instead, pyenv's shim
approach works by adding a directory to your PATH.
Manage virtualenv. Of course, you can create virtualenv
yourself, or pyenv-virtualenv
to automate the process.
----
Table of Contents
Installation
Getting Pyenv
Linux/UNIX
Automatic Installer
Basic GitHub Checkout
MacOS
Homebrew in macOS
Windows
Set up your shell environment for Pyenv
Restart your shell
Install Python build dependencies
Upgrade Notes
Usage
Install additional Python versions
Prefix auto-resolution to the latest version
Python versions with extended support
Switch between Python versions
Making multiple versions available
Uninstall Python versions
Other operations
Upgrading
Upgrading with Homebrew
Upgrading with Installer or Git checkout
Uninstalling pyenv
Pyenv plugins
How It Works
Understanding PATH
Understanding Shims
Understanding Python version selection
Locating Pyenv-provided Python Installations
Advanced Configuration
Using Pyenv without shims
Running nested shells from Python-based programs
Environment variables
Manual shell setup
Development
Contributing
Version History
License
----
Installation
A. Getting Pyenv
----
Linux/Unix
The Homebrew option from the MacOS section below would also work if you have Homebrew installed.
1. Automatic installer (Recommended)
bash
curl -fsSL https://pyenv.run | bash
For more details visit our other project:
https://github.com/pyenv/pyenv-installer
2. Basic GitHub Checkout
This will get you going with the latest version of Pyenv and make it
easy to fork and contribute any changes back upstream.
Check out Pyenv where you want it installed.
A good place to choose is $HOME/.pyenv (but you can install it somewhere else):
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
Optionally, try to compile a dynamic Bash extension to speed up Pyenv. Don't
worry if it fails; Pyenv wiTop issues
#2334Provide prebuilt CPython for common environments60 comments · 2022-04-22#2204pythons built with pyenv's python-build leak CFLAGS/LDFLAGS into user packages via sysconfig24 comments · 2022-01-02#2417Pyenv Pythons use the same user site as the system Python (causes: `pyenv` does not install `pip`: "Requirement already satisfied: pip" if a Pip update is installed in `~/.local`)19 comments · 2022-07-25#2588pyenv install 3.11.1 fails on ARM MacOS 13.1: "make: ./_bootstrap_python: Permission denied" on a Managed machine17 comments · 2023-01-10#3497Unable to Build 3.14.6 against a source install of OpenSSL despite passing `--with-openssl`14 comments · 2026-07-21#1233Utilize pyproject.toml (PEP518)13 comments · 2018-10-30#1702SQLite extension support12 comments · 2020-09-28#2802Shims are too slow10 comments · 2023-09-29
Discussions
#3609Instruction to install/update pyenv using mac ports?4 comments · 2026-10-27#3551Adding a lightweight GUI to the app1 comments · 2026-09-19#3476Manage additional environment variables?1 comments · 2026-06-16#3471ccline: ask your shell anything in plain English — built for Python devs who live in the terminal0 comments · 2026-06-10#3383Line-endings CRLF or LF1 comments · 2026-01-07#3378pyenv shim handling with BitBake1 comments · 2025-12-22#3351Python build is incredibly slow when built with sudo, compared to building as root1 comments · 2025-10-21#3345"pyenv: cannot rehash: /Users/wyattwong/.pyenv/shims/.pyenv-shim exists" error1 comments · 2025-10-10
Latest release
v2.8.14 v2.8.14 2026-10-26What's Changed README: fix pyenv init --install usage in suggested shell setup by @dcadolph in https://github.com/pyenv/pyenv/pull/3603 Graalpy cleanup by @native-api in https://github.com/pyenv/pyenv/pull/3602 Add CPython 3.11.18 by @pyenv-bot[bot] in https://github.com/pyenv/pyenv/pull/3605 Add CPython 3.12.16, 3.13.18, 3.14.10, 3.15.2 by @pyenv-bot[bot] in https://github.com/pyenv/pyenv/pull/3604 Prefer Tcl/Tk 9 for 3.15+ by @native-api in https://github.com/pyenv/pyenv/pull/3606 New Contributors @dcadolph made their first contribution in https://github.com/pyenv/pyenv/pull/