If your’e hacking in many Python projects in parallell you will sooner or later run in to a Python package hell. The different projects might need different versions of Python or some package. I have also found it comfortable to know what packages the code I develop on actually depends on. A wonderful solution for this kind of problems is virtualenv
.
virtualenv
allows you to have a totally isolated Python environment for each of your projects.
sudo pip install virtualenv
cd /your/project-1
virtualenv virtualenv
source virtualenv/bin/activate
Your PS1
in Bash will now look something like this:
(virtualenv)[sebastian ~/git/git-hall-of-fame (master)]$
So anything you install via pip
or easy_install
now will be installed for this virtualenv
only.
I have one virtualenv
for each of my projects inside the git
structure, and then I add virtualenv
to .gitignore
to keep the changes locally.