[Distutils] Question about easy-install.pth

Brian Cameron Brian.Cameron at Sun.COM
Wed Oct 1 08:12:20 CEST 2008

I am having troubles working with setuptools on Solaris.  The Solaris 
operating system normally installs modules as packages which contain
binaries.  This is unlike other Linux operating systems where, for
exmaple, an RPM would download the source and build it on the user's
machine when they install the RPM.

So, to create packages on Solaris we normally install a module to
a temporary directory such as /var/tmp/pkgbuild-foo/usr, package up
the files that are built, and when the user installs the package
these files are then installed to their system.

However, we are having problems with figuring out how to properly
create the /usr/lib/python2.4/site-packages/easy-install.pth file
using our build system.  What happens is that each package ends up
with its own easy-install.pth file which only contains the
information for that one module.  Users can't install two such
packages at the same time because it creates a file conflict, two
packages can't install the same file.

Solaris packages do have pre-install, post-install, pre-uninstall
and post-uninstall scripts so that we could do something like avoid
installing the file as a part of the package and instead generate it
on-the-fly via scripting.  However, it doesn't seem that setuptools
provides any mechanisms for doing this easily.  Though I'm not very
familiar with setuptools or easy_install, so I hope that I'm missing

Aside from writing our own code to manually manage adding and removing
entries to/from this file, is there any way that setuptools allows you
to manage this file when installing binaries to a system, or does
setuptools assume the file only needs to be managed when you build a

I'm hoping to avoid some hacky solution where we try and hack the
easy-install.pth file by hand when users install or uninstall packages.
Since users can install or uninstall any random combination of
packages which may need an easy-install.pth file, I can imagine that
it would get complicated to properly manage it via our own scripts.

Or is there some other solution that might be useful in our situation
that might avoid the need for multiple packages to need this file, or
might it be possible for different modules to use differently named
files instead of a commonly named easy-install.pth file.


More information about the Distutils-SIG mailing list