[BioPython] development question

Kevin Teague kteague at bcgsc.ca
Wed Oct 1 21:53:44 UTC 2008



On Thu, Aug 28, 2008 at 10:06:51AM +0200, Pavel SRB wrote:
> so now to biopython. On my system i have biopython from debian repository 
> via apt-get. But i would like to have second version of biopython in system 
> just to check, log and change the code to learn more. This can be done with 
> removing sys.path.remove("/var/lib/python-support/python2.5")
> and importing Bio from some other development directory. But this way i 
> loose all modules in direcotory mentioned above and i believe it can be 
> done more clearly

You might want to check out VirtualEnv:

http://pypi.python.org/pypi/virtualenv

This tool will let you "clone" your system Python, so that you have your own isolated [virtualpythonname]/bin and [virtualpythonname/lib/python/site-packages/ directories. If you create a virtualenv with the --no-site-packages, then the /var/lib/python-support/python2.5/ location will be not be in the created virtual python's sys.path. Otherwise by default this location will be included, but your own isolated [virtualpythonname/lib/python/site-packages/ location will have precendence on sys.path, so if you install a newer BioPython into there it will get imported instead of the system one.

You can of course do all of this by manually fiddling with sys.path, but VirtualEnv just wraps up a few of these common practices into one handy tool - great for experimentation or trying out different packages.





More information about the Biopython mailing list