Adding your own site directories cleanly and supportedly?

David Fraser davidf at sjsoft.com
Thu May 27 16:53:28 EDT 2004


Tim Bradshaw wrote:
> We have a situation where, on our production machines, we will
> probably have a standard Python installation which is installed with
> the system build, and which we want to use for various possible
> applications.  These applications will probably have different library
> requirements, and may have conflicting requirements.  We don't *know*
> they will, but they may do and we don't want to have to worry about
> it, basically.
> 
> As an example, my application uses Numeric.  I suspect that no-one
> else does, but I don't want to find out that they do, and they use an
> incompatible version.  Of course, we should really establish a
> standard version and install the centrally and so on, but we probably
> don't have time for that.  Different versions of the application might
> also need different versions of Numeric, and they need to be able to
> coexist painlessly.
Aha! Another reason to use a multi-version script like we have been 
talking about for wxPython. If you search the newsgroup for wxselect you 
should find a script you may be able to adapt for selecting versions of 
other modules...
> 
> This looks easy to solve: Numeric uses distutils, so we can just have
> per-application site directories, where applications put the things
> they need with no fear of interference.
> 
We've been doing some modifications to the Numeric setup script that 
make it easier to include in your application installer.

> Ah, but.  How do I add an application-specific site directory, and do
> all the .pth file searching?  It looks like I can call
> site.addsitedir() to add a directory of my choosing, and this will all
> work.  This is all fine.



More information about the Python-list mailing list