UserWarning: Unbuilt egg for setuptools [unknown version] (/usr/lib/python2.6/dist-packages)

Bug #576434 reported by Marius Gedminas on 2010-05-06
104
This bug affects 20 people
Affects Status Importance Assigned to Milestone
Tahoe-LAFS
New
Unknown
distribute (Ubuntu)
Undecided
Unassigned

Bug Description

Steps to reproduce:

  virtualenv /tmp/sandbox
  /tmp/sandbox/easy_install anything

The first line printed by easy_install is

  /tmp/sandbox/lib/python2.6/site-packages/distribute-0.6.10-py2.6.egg/setuptools/command/easy_install.py:198: UserWarning: Unbuilt egg for setuptools [unknown version] (/usr/lib/python2.6/dist-packages)

This warning appears every time I use easy_install or zc.buildout.

I think it's caused by python-setuptools shipping an empty directory /usr/lib/python2.6/dist-packages/setuptools.egg-info

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: python-setuptools 0.6.10-4ubuntu1
ProcVersionSignature: Ubuntu 2.6.32-22.33-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-22-generic i686
Architecture: i386
Date: Thu May 6 17:34:37 2010
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=lt_LT:lt:en_GB:en
 LC_CTYPE=lt_LT.UTF-8
 PATH=(custom, user)
 LANG=lt_LT.utf8
 SHELL=/bin/bash
SourcePackage: distribute

Marius Gedminas (mgedmin) wrote :
Marius Gedminas (mgedmin) wrote :

Workaround:

  sudo rmdir /usr/lib/python2.6/dist-packages/setuptools.egg-info
  sudo apt-get install --reinstall python-setuptools

This replaces the empty directory
/usr/lib/python2.6/dist-packages/setuptools.egg-info with a symlink to /usr/share/pyshared/setuptools.egg-info which is a file, not a directory.

Why did I have an empty directory there? Something left remaining from an older python-setuptools package? This system is not a fresh Lucid install; it was upgraded from Karmic (which did not spew any UserWarnings). AFAIK dpkg itself doesn't handle transitions from directories to symlinks. Shouldn't python-setuptools ship a postinst script to correct this during upgrades?

Pykler (hnassrat) wrote :

I have notices the same warning, Also upgraded from karmic to Lucid. The workaround cleared the warning for me too.

Māris Fogels (mars) wrote :

This completely breaks zc.buildout. If you are bitten by this, you will see something similar to the following:

An internal error occured due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
 ...
ValueError: ("Missing 'Version:' header and/or PKG-INFO file", setuptools [unknown version] (/usr/lib/python2.6/dist-packages))

The workaround from Marius allows you to get past the error. Thanks Marius!

Changed in distribute (Ubuntu):
status: New → Confirmed

Same error from Karmic to Lucd

Geoff Bache (geoff.bache) wrote :

Same error upgrading from Hardy to Lucid.

Māris Fogels (mars) wrote :

This bug appears to be related to bug 490731, "python-setuptools: import setuptools returns ValueError: ("Missing 'Version:' ...)".

TJ (tj) wrote :

Affected by this issue after a Hardy to Lucid upgrade. I found the workaround in comment #2 aren't quite sufficient since it contains several broken sym-links after the upgrade:

ls -l /usr/lib/python2.6/dist-packages/setuptools.egg-info
total 4
lrwxrwxrwx 1 root root 60 2010-06-20 12:35 dependency_links.txt -> /usr/share/pyshared/setuptools.egg-info/dependency_links.txt
lrwxrwxrwx 1 root root 56 2010-06-20 12:35 entry_points.txt -> /usr/share/pyshared/setuptools.egg-info/entry_points.txt
lrwxrwxrwx 1 root root 52 2010-06-20 12:35 not-zip-safe -> /usr/share/pyshared/setuptools.egg-info/not-zip-safe
lrwxrwxrwx 1 root root 48 2010-06-20 12:35 PKG-INFO -> /usr/share/pyshared/setuptools.egg-info/PKG-INFO
lrwxrwxrwx 1 root root 51 2010-06-20 12:35 SOURCES.txt -> /usr/share/pyshared/setuptools.egg-info/SOURCES.txt
lrwxrwxrwx 1 root root 53 2010-06-20 12:35 top_level.txt -> /usr/share/pyshared/setuptools.egg-info/top_level.txt
lrwxrwxrwx 1 root root 48 2010-06-20 12:35 zip-safe -> /usr/share/pyshared/setuptools.egg-info/zip-safe

Instead I did:

sudo rm -rf /usr/lib/python2.6/dist-packages/setuptools.egg-info
sudo apt-get install --reinstall python-setuptools

After which the system has:

ls -l /usr/lib/python2.6/dist-packages/setuptools.egg-info
lrwxrwxrwx 1 root root 43 2010-06-20 18:27 /usr/lib/python2.6/dist-packages/setuptools.egg-info -> ../../../share/pyshared/setuptools.egg-info

Allan (allan-stokes) wrote :

The fix above eliminated the warning message I was getting under Lucid running Scons 2.0.0.final.0 as released 14 June 2010. Thanks for sharing, TJ.

Jim Hunziker (landtuna) wrote :

Same error updating from Lucid to Maverick and then using Scons. The python-setuptools reinstall fix above fixed it.

Daira Hopwood (daira) wrote :

We are seeing this bug on one of the Tahoe-LAFS buildslaves: http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1235

Changed in tahoe-lafs:
status: Unknown → New
chris is fun (chris-sproutbox) wrote :

  sudo rmdir /usr/lib/python2.6/dist-packages/setuptools.egg-info
  sudo apt-get install --reinstall python-setuptools

worked for me as well. Ubuntu 10.04, Lenovo T60.

$ grep -h python-setuptools /var/log/dpkg.log{.1,}
2011-02-04 12:52:28 upgrade python-setuptools 0.6.10-4ubuntu1 0.6.10-4ubuntu1
2011-02-04 12:52:28 status half-configured python-setuptools 0.6.10-4ubuntu1
2011-02-04 12:52:29 status unpacked python-setuptools 0.6.10-4ubuntu1
2011-02-04 12:52:29 status half-installed python-setuptools 0.6.10-4ubuntu1
2011-02-04 12:52:31 status half-installed python-setuptools 0.6.10-4ubuntu1
2011-02-04 12:52:32 status unpacked python-setuptools 0.6.10-4ubuntu1
2011-02-04 12:52:32 status unpacked python-setuptools 0.6.10-4ubuntu1
2011-02-04 12:52:33 configure python-setuptools 0.6.10-4ubuntu1 0.6.10-4ubuntu1
2011-02-04 12:52:33 status unpacked python-setuptools 0.6.10-4ubuntu1
2011-02-04 12:52:33 status half-configured python-setuptools 0.6.10-4ubuntu1
2011-02-04 12:52:33 status installed python-setuptools 0.6.10-4ubuntu1
2011-02-04 12:52:34 status triggers-awaited python-setuptools 0.6.10-4ubuntu1
2011-02-04 12:52:34 status installed python-setuptools 0.6.10-4ubuntu1

Error message happened while I was trying to follow these directions: https://wiki.ubuntu.com/GmailFS.

Haw Loeung (hloeung) wrote :

I'm having this problem as well:

/usr/lib/python2.6/dist-packages/chameleon/template.py:22: UserWarning: Unbuilt egg for setuptools [unknown version] (/usr/lib/python2.6/dist-packages)
  if distribution.has_version():

$ ls /usr/lib/python2.6/dist-packages/setuptools.egg-info -la
total 12
drwxr-xr-x 2 root root 4096 2010-06-14 15:07 .
drwxr-xr-x 36 root root 4096 2011-12-16 15:11 ..
lrwxrwxrwx 1 root root 60 2010-06-14 15:07 dependency_links.txt -> /usr/share/pyshared/setuptools.egg-info/dependency_links.txt
lrwxrwxrwx 1 root root 56 2010-06-14 15:07 entry_points.txt -> /usr/share/pyshared/setuptools.egg-info/entry_points.txt
lrwxrwxrwx 1 root root 52 2010-06-14 15:07 not-zip-safe -> /usr/share/pyshared/setuptools.egg-info/not-zip-safe
lrwxrwxrwx 1 root root 48 2010-06-14 15:07 PKG-INFO -> /usr/share/pyshared/setuptools.egg-info/PKG-INFO
lrwxrwxrwx 1 root root 51 2010-06-14 15:07 SOURCES.txt -> /usr/share/pyshared/setuptools.egg-info/SOURCES.txt
lrwxrwxrwx 1 root root 53 2010-06-14 15:07 top_level.txt -> /usr/share/pyshared/setuptools.egg-info/top_level.txt
lrwxrwxrwx 1 root root 48 2010-06-14 15:07 zip-safe -> /usr/share/pyshared/setuptools.egg-info/zip-safe

$ ls -la /usr/share/pyshared/setuptools.egg-info/dependency_links.txt
ls: cannot access /usr/share/pyshared/setuptools.egg-info/dependency_links.txt: Not a directory

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.