pyenv – Python version manager

The pyenv is a fork from rbenv for managing Python versions on your machine.


Here is the steps to install pyenv thru homebrew. Alternatively you could install thru the pyenv-installer and replace step 1 – 4 below.

1. Update your homebrew.

brew update


2. Install pyenv thru homebrew.

brew install pyenv


3. Add the following line to your shell profile. For OSX, add it to ~/.profile.

eval "$(pyenv init -)"


4. Restart the shell.

5. Check your pyenv installation.

pyenv --version


6. Install a Python. If you come across any errors on this step, please refer to yyuu/pyenv – Common build problems.

pyenv install 2.7.6


7. Switch to the newly installed Python version globally.

pyenv global 2.7.6


8. Verify your Python version

python --version


9. You can list the installed Python in your machine.

pyenv versions


10. Each installed Python are could be found under ~/.pyenv/versions.

11. Whenever you have installed or uninstalled a package, run the following command.

pyenv rehash


Done =)

Reference: Dave Behnke – Building Python on Ubuntu with pyenv

Next: Manage your Python projects with virtualenv


2 thoughts on “pyenv – Python version manager”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.