Putting site-packages somewhere else

Pearu Peterson pearu at cens.ioc.ee
Mon Oct 29 16:33:26 CET 2001

Here is one simple (but not very nice way, I guess) to cheat both Encap
and Distutils (never tried myself, though):
1) install python. Then from your descriptions there should be
   /usr/local/encap/python-2.1.1     - a directory
   /usr/local/lib/python-2.1 - a link pointing to
2) Move /usr/local/encap/python-2.1.1/lib/python-2.1/site-packages
somewhere where you like it to be, say, /path/to/site-packages.
3) Create symbolic link
/usr/local/encap/python-2.1.1/lib/python-2.1/site-packages pointing to


On Sun, 28 Oct 2001, Lars Kellogg-Stedman wrote:

> I'm a long-time perl user who's recently started working more with Python.
> I'm also responsible for software packaging and distribution at my
> employer, and I'm looking for some suggestions in maintaining our Python
> distribution.
> We're using an Encap-based software distribution system, which means that
> each software package is installed into its own subdirectory, e.g.,
> '/usr/local/encap/python-2.1.1', and then symlinks are created so that it
> appears in /usr/local.
> The problem is that additional modules -- e.g., modules that end up in
> site-packages -- should *not* get installed into the package directory.
> They should be placed in, e.g., /usr/local/lib/python2.1/site-packages,
> rather than /usr/local/encap/python-2.1.1/lib/python2.1/site-packages,
> which is where they're going right now.
> After spending some time looking through the Python documentation and
> perusing some mailing list archives, I haven't found a good way of doing
> this.  The solution needs to fulfill the following requirements:
>   (1) Distutils needs to know about the proper location for packages,
>       so that no additional flags need be specified on the command line.
>   (2) The interpreter needs to know about the site-packages directory
>       *outside* of the python installation prefix.
> I thought that perhaps I could modify site.py to add the additional
> path(s), but after reading through the comments in that file, I'm not
> exactly sure how I would go about making those changes.  I'm sure this is a
> common problem with a simple solution; I'd appreciate it if someone could
> point me at it.
> Thanks!
> -- Lars
> -- 
> Lars Kellogg-Stedman <lars at larsshack.org>

More information about the Python-list mailing list