pyenv /pyenv

Simple Python version management

★ 45,184⑂ 3,271👁 387⑃ 1,429● 1,920▤ 174◈ 141
ShellMITCreated 2012-08-31
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 wi

Top issues

Discussions

Latest release

v2.8.14 v2.8.14 2026-10-26
What'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/

Snapshot: 2026-11-10T09:35:25Z · Data license Apache-2.0 · JSON