The pythonbrew utility is a complete environment manager for Python. It allows one to list and switch permanently between python versions or just as a temporary in the current shell session.
Usage syntax is very simple:
pythonbrew command [options]
And here are some command examples from its README document (that file on github also includes the installation procedure), showcasing its set of features:
# Install some pythons: pythonbrew install 2.7.2 pythonbrew install --verbose 2.7.2 pythonbrew install --force 2.7.2 pythonbrew install --no-test 2.7.2 pythonbrew install --configure="CC=gcc_4.1" 2.7.2 pythonbrew install --no-setuptools 2.7.2 pythonbrew install http://www.python.org/ftp/python/2.7/Python-2.7.2.tgz pythonbrew install /path/to/Python-2.7.2.tgz pythonbrew install /path/to/Python-2.7.2 pythonbrew install 2.7.2 3.2 # Permanently use the specified python: pythonbrew switch 2.7.2 pythonbrew switch 3.2 # Use the specified python in current shell: pythonbrew use 2.7.2 # Runs a named python file against specified and/or all pythons: pythonbrew py test.py pythonbrew py -v test.py # Show verbose output pythonbrew py -p 2.7.2 -p 3.2 test.py # Use the specified pythons # List the installed pythons: pythonbrew list # List the available installation pythons: pythonbrew list -k # Uninstall the specified python: pythonbrew uninstall 2.7.2 pythonbrew uninstall 2.7.2 3.2 # Remove stale source folders and archives: pythonbrew cleanup # Upgrades pythonbrew to the latest version: pythonbrew update pythonbrew update --master pythonbrew update --develop # Disable pythonbrew: pythonbrew off # Create/Remove a symbolic link to python (in a directory on your $PATH): pythonbrew symlink # Create a symbolic link, like "py2.7.2", for each installed version pythonbrew symlink -p 2.7.2 pythonbrew symlink pip # Create a symbolic link to the specified script in bin directory pythonbrew symlink -r # Remove a symbolic link pythonbrew symlink -v foo # Create a symbolic link to the specified virtual environment python in bin directory # Runs the buildout with specified or current using python: pythonbrew buildout pythonbrew buildout -p 2.6.6 # Create isolated python environments (uses virtualenv): pythonbrew venv init pythonbrew venv create proj pythonbrew venv list pythonbrew venv use proj pythonbrew venv delete proj # Show version: pythonbrew version
Whoa, that’s amazing! Thanks for this one, I’ll use it for sure :)