Using pyenv with virtualenv and pip cheat sheet

I need to remember this checklist…


I made some notes on how to use a specific python version with pyenv and using virtualenv to manage packages.

using pyenv


$ git clone ~/.pyenv


$ export PYENV_ROOT="$HOME/.pyenv"
$ export PATH="$PYENV_ROOT/bin:$PATH"
$ eval "$(pyenv init -)"

use command completion

$ source ~/.pyenv/completions/pyenv.bash

(homebrew on mac)

$ mkdir ~/pyenv/completions
$ cp /usr/local/Cellar/pyenv/20150601/completions/pyenv.bash ~/.pyenv/completions/pyenv.bash

use pyenv to install python versions

$ pyenv install 2.7.10
$ pyenv install 3.4.3

choose a python version with pyenv

$ pyenv shell PYENV_VERSION=2.7.10

upgrade pyenv

$ cd ~/.pyenv; git pull

(homebrew on mac)

$ brew upgrade pyenv

run `pyenv rehash` when you install a new python or binary package

$ pyenv rehash

install pyenv-pip-rehash to rehash automatically when you use pip

(as pyenv plugin)

$ git clone ~/.pyenv/plugins/pyenv-pip-rehash

(homebrew on mac)

$ brew install homebrew/boneyard/pyenv-pip-rehash

install pyenv-virtualenv

$ git clone ~/.pyenv/plugins/pyenv-virtualenv

intialize pyenv-virtualenv

$ eval "$(pyenv virtualenv-init -)"

(homebrew on…

View original post 39 more words