[Python-ideas] PYTHONUSERBASES (plural!)

Nick Coghlan ncoghlan at gmail.com
Thu Apr 23 07:54:23 CEST 2009


Larry Hastings wrote:
> 
> Nick Coghlan wrote:
>> You would have two different directories each with a different .pth file
>> in it and point PYTHONUSERBASE at the correct one for the virtual
>> environment you want to use.
> 
> This would preclude finding packages in my default PYTHONUSERBASE.  Or
> combining any two virtualized environments together.

Put "my_default_dir.pth" in each of your virtual environments
(preferably via a symlink if you aren't on Windows). If you want to mix
two environments together, put both of their .pth files in a single
directory (again via symlink if you can).

A collection of .pth files in a directory is easy to manage. Messing
with environment variables is a PITA - you need an external solution to
keep track of what the environment variable should contain for each
environment.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------



More information about the Python-ideas mailing list