[PEAK] installation troubles / how to uninstall setup tools

Karl Pietrzak kap4020 at rit.edu
Thu Feb 9 17:46:16 EST 2006


On Thursday 09 February 2006 17:27, Phillip J. Eby wrote:
> For future reference, the installation instructions are here:
>
> http://peak.telecommunity.com/DevCenter/EasyInstall
>
> This page was linked to by both of the top Google links, as well as by the
> funkload page, so I'm not sure why it's not at the top of the Google
> search.  Probably it doesn't have "installing Python eggs" used enough as a
> phrase; I'll try to remedy that.

Well, I spent a good deal of time reading the EasyInstall page.  The first 
sentence on the page says, "Easy Install is a python module (easy_install) 
bundled with setuptools that lets you automatically download, build, install, 
and manage Python packages.".

Nowhere does it actually say "Python eggs", so I wasn't even sure I was on the 
right page.  I looked at the Table of Contents and thought, "Hmm, maybe 
'Downloading and Installing a Package' is the right section".

So there, I finally got my first evidence that easy_install installs Python 
eggs.  I didn't know where EasyInstall came from, and I actually tried just 
executing easy_install on my command-line.

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.

> 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

> As a result, setuptools has failed to 
> install itself here in a way that is importable.  I think I know how to fix
> this problem, assuming that the distutils on your machine know that this is
> the correct directory.
>
> In the meantime, however, if you are willing to experiment, I would ask you
> to try this:
>
>      ez_setup.py --site-dirs=/usr/lib64/python2.4/site-packages setuptools
>
> If this works (i.e, you can then run Python and import pkg_resources), then
> all I need to do to fix setuptools is to get it to figure out that the
> lib64 site-packages is valid automatically.  We can also tweak your
> configuration so that you don't have to manually specify --site-dirs every
> time you use easy_install before I get setuptools fixed.

This is what I get:

# python ez_setup.py --site-dirs=/usr/lib64/python2.4/site-packages setuptools
Downloading 
http://cheeseshop.python.org/packages/2.4/s/setuptools/setuptools-0.6a9-py2.4.egg
Searching for setuptools
Best match: setuptools 0.6a9
Processing setuptools-0.6a9-py2.4.egg
Adding setuptools 0.6a9 to easy-install.pth file
error: /usr/lib64/python2.4/site-packages/easy-install.pth: Permission denied
# su -
Password:
# cd /tmp/
# python ez_setup.py --site-dirs=/usr/lib64/python2.4/site-packages setuptools
Downloading 
http://cheeseshop.python.org/packages/2.4/s/setuptools/setuptools-0.6a9-py2.4.egg
Searching for setuptools
Best match: setuptools 0.6a9
Processing setuptools-0.6a9-py2.4.egg
Adding setuptools 0.6a9 to easy-install.pth file
Installing easy_install script to /usr/bin

Using /usr/lib64/python2.4/site-packages/setuptools-0.6a9-py2.4.egg
Processing dependencies for setuptools
Processing setuptools-0.6a9-py2.4.egg
removing '/usr/lib64/python2.4/site-packages/setuptools-0.6a9-py2.4.egg' (and 
everything under it)
creating /usr/lib64/python2.4/site-packages/setuptools-0.6a9-py2.4.egg
Extracting setuptools-0.6a9-py2.4.egg to /usr/lib64/python2.4/site-packages
setuptools 0.6a9 is already the active version in easy-install.pth
Installing easy_install script to /usr/bin

Installed /usr/lib64/python2.4/site-packages/setuptools-0.6a9-py2.4.egg
Processing dependencies for setuptools==0.6a9
Searching for setuptools
Best match: setuptools 0.6a9
Processing setuptools-0.6a9-py2.4.egg
setuptools 0.6a9 is already the active version in easy-install.pth
Installing easy_install script to /usr/bin

Using /usr/lib64/python2.4/site-packages/setuptools-0.6a9-py2.4.egg
Processing dependencies for setuptools
#

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.

OK, how can I tweak it?  Mind you, I think all this should be automatic.  An 
RPM would be nice.  An autopackage even better.

> >2. How do I uninstall the setuptools now installed on my machine?
>
> Based on the output you showed, these commands should be sufficient:
>
>    rm -rf /usr/lib64/python2.4/site-packages/setuptools-0.6a9-py2.4.egg
>    rm /usr/bin/easy_install
>
> I'm sorry you had a bad experience, but if you're willing to spend a few
> minutes trying the --site-dirs option I hope there's a chance to salvage
> you as a "customer".  :)

Yup, I'm willing to be "salvaged". :)  Just tell me what I can do, and I'll 
let you know what can be improved.



More information about the PEAK mailing list