[PEAK] installation troubles / how to uninstall setup tools

Phillip J. Eby pje at telecommunity.com
Thu Feb 9 18:04:50 EST 2006

At 05:46 PM 2/9/2006 -0500, Karl Pietrzak wrote:
>Now, I go back and see that "Installing EasyInstall" is in the Table of
>Contents, but I had no idea that EasyInstall is the only way to install
>Python eggs.

I see your point.  Having been working on setuptools and eggs for almost a 
year now, it's easy to become blind to the obvious.  :)  I'm trying to 
recruit volunteers to help pull out a separate "quickstart/FAQ" page for 
folks in your situation, although with the bugs you encountered, it 
wouldn't have helped (except for saying where to send problem reports).

> > It appears there is something unusual about your setup.  Normally, Python
> > expects its libraries to be in $PREFIX/lib/python2.4/site-packages, and
> > there isn't any way for setuptools to tell that your particular
> > installation has an unusual directory layout, or at least not any obvious
> > way that I know of at present.
>Can't you just do this?
>def determineSitePackagesDirectories():
>         listOfDirectories = []
>         for dir in sys.path:
>                 if os.path.isdir(dir) and os.path.basename(dir) == 
> 'site-packages':
>                         listOfDirectories.append(dir)
>         return listOfDirectories

Unfortunately, it's not enough to know if the directory's *name* is 
site-packages.  The crucial variable is whether the directory is being 
processed by Python for .pth files at startup.  This is how setuptools 
supports having both "default" and "on-demand" versions of a package 
installed at the same time.

I am, however, working on making this a more painless process.  The fact 
that most Linux distros patch Python in mutually incompatible ways doesn't 
help much, though.  :(

>Looks good!  Didn't realize that I need to be root.  Can't you do a local
>install into ~/.local?  After all, there is a .pythonrc.py that one can use.

Please see the "Custom Installation Location" docs:


This will help you pick the best installation scheme for your machine and 
intended uses.

>OK, how can I tweak it?

Create or edit /usr/lib64/python2.4/distutils/distutils.cfg, with these lines:

site_dirs = /usr/lib64/python2.4/site-packages

That's it; the --site-dirs will now be automatic on your machine.

>   Mind you, I think all this should be automatic.  An
>RPM would be nice.  An autopackage even better.

If you check out the setuptools sources from:


you can just run "python2.4 setup.py bdist_rpm" to build an RPM.  I haven't 
tested actually *installing* the resulting RPM, but I'd be interested to 
know if it actually works.  :)  You may want to pass the --fix-python 
option to bdist_rpm so that it uses the same version and architecture of 
Python to do the installation.

Unfortunately, this won't alleviate the need for the --site-dirs option, at 
least not until I check in my possible fix for the lib64 issue.

More information about the PEAK mailing list