If you have only a few projects each so often, nothing prevents you from creating a new virtualenv for each of them and putting your packages right inside:
/foobar /bin {activate, activate.py, easy_install, python} /include {python2.6/...} /lib {python2.6/...} /mypackage1 __init__.py /mypackage2 __init__.py
The advantage of this approach is that you can always find to find the activated script that belongs to the project inside.
$ cd /foobar $ source bin/activate $ python >>> import mypackage1 >>>
If you decide to be more organized, you should consider placing all your virtual users in one folder and name each of them after the project you are working on.
/virtualenvs /foobar /bin {activate, activate.py, easy_install, python} /include {python2.6/...} /lib {python2.6/...} /foobar /mypackage1 __init__.py /mypackage2 __init__.py
That way, you can always start with the new virtualenv when something goes wrong and your project files remain safe.
Another advantage is that some of your projects can use the same virtualenv, so you wonβt have to do the same installation over and over again if you have many dependencies.
$ cd /foobar $ source ../virtualenvs/foobar/bin/activate $ python >>> import mypackage2 >>>
For users who regularly have to install and reset virtual virtual machines, it would be wise to look at virtualenvwrapper.
http:
With virtualenvwrapper you can
* create and delete virtual environments * organize virtual environments in a central place * easily switch between environments
You no longer need to worry about where your virtual users are when working on the "foo" and "bar" projects:
/foo /mypackage1 __init__.py /bar /mypackage2 __init__.py
Here's how you get started on the foo project:
$ cd foo $ workon bar foo $ workon foo (foo)$ python >>> import mypackage1 >>>
Then switching to the bar of the project is just as easy:
$ cd ../bar $ workon bar (bar)$ python >>> import mypackage2 >>>
Pretty neat, right?