Skip to content

Instantly share code, notes, and snippets.

@donigian
Created June 21, 2012 07:13
Show Gist options
  • Save donigian/2964353 to your computer and use it in GitHub Desktop.
Save donigian/2964353 to your computer and use it in GitHub Desktop.
pythonbrew: Get up & running
pythonbrew is a program to automate the building and installation of Python in the users $HOME.
This is a clean way to install/manage multiple versions of python.
1. curl -kL http://xrl.us/pythonbrewinstall | bash
2. add to the end of your ~/.bashrc:
[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc
3. pythonbrew install 2.7.2, pythonbrew install 3.2
4. for other useful commands, type pythonbrew help <command>
5. Create isolated python environments (uses virtualenv):
pythonbrew venv init
pythonbrew venv create proj
pythonbrew venv list
pythonbrew venv use proj (pythonbrew venv use socialwebhack, mongoDb_GNSS_trackingApp)
pythonbrew venv delete proj
pythonbrew venv rename proj proj2
OR
# .profile on OSX or .bashrc
virtualenv + virtualenvwrapper
source /usr/local/bin/virtualenvwrapper/sh
mkvirtualenv name
workon name
pip install Django
# Dump it to a requirements file in the project folder
pip freeze -l > requirements.txt
# Install packages from requirements file
pip install -r requirements.txt
to install homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment