Files
John Vrbanac 9082b9b3b4 Adding a quick howto on setting up virtualenvs
Change-Id: I0f49a3e8cd47a9b8303261ccffa0c3e9f260a1fc
2014-01-27 16:56:35 -06:00

1.3 KiB

Working with pyenv

Installing pyenv

The official installation guide is available here pyenv on github. The official guide includes instructions for Mac OS X as well.

Installing pyenv on Ubuntu:

sudo apt-get install git python-pip make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev
sudo pip install virtualenvwrapper

git clone https://github.com/yyuu/pyenv.git ~/.pyenv
git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
echo 'pyenv virtualenvwrapper' >> ~/.bashrc

exec $SHELL

Installing a fresh version of Python

Now that pyenv and the virtualenvwrapper plugin is installed. We need to download and install a version of python. In this case, we're going to install Python 2.7.6.

# Install
pyenv install 2.7.6

# Set 2.7.6 as your shell default
pyenv global 2.7.6