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
2 thoughts on “pyenv – Python version manager”