python-setuptools: import setuptools returns ValueError: ("Missing 'Version:' ...)

Bug #490731 reported by Integer
48
This bug affects 6 people
Affects Status Importance Assigned to Milestone
python-setuptools
New
Undecided
Unassigned
distribute (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I upgraded my distribution and i got an error when trying to use setuptools:

There is the description of error below:
ValueError: ("Missing 'Version:' header and/or PKG-INFO file", setuptools [unknown version] (/usr/lib/python2.6/dist-packages))

Possible solution:

I solved this error by myself with these conditions / steps:

* wget http://python-distribute.org/distribute_setup_dev.py
* sudo python distribute_setup_dev.py

and it works now.. Please fix this error on ubuntu packages..

ProblemType: Bug
Architecture: amd64
Date: Tue Dec 1 10:31:17 2009
DistroRelease: Ubuntu 10.04
NonfreeKernelModules: nvidia
Package: python-setuptools 0.6.8-1ubuntu1
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=tr_TR.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-5.6-generic
SourcePackage: distribute
Uname: Linux 2.6.32-5-generic x86_64

Related branches

Revision history for this message
Integer (gurkanaslan) wrote :
Revision history for this message
Michael Bienia (geser) wrote :

It already fails on importing pkg_resources:

>>> import pkg_resources
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2656, in <module>
    add_activation_listener(lambda dist: dist.activate())
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 647, in subscribe
    callback(dist)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2656, in <lambda>
    add_activation_listener(lambda dist: dist.activate())
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2162, in activate
    self.insert_on(path)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2256, in insert_on
    if '0.7' in self.version:
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2120, in version
    "Missing 'Version:' header and/or PKG-INFO file", self
ValueError: ("Missing 'Version:' header and/or PKG-INFO file", setuptools [unknown version] (/usr/lib/python2.6/dist-packages))

ii python-pkg-resources 0.6.8-1ubuntu1 Package Discovery and Resource Access using

Revision history for this message
Michael Bienia (geser) wrote :

This seems to be an upgrade issue of "python-setuptools" from 0.6c9-0ubuntu5 to 0.6.8-1ubuntu1.
A fresh install of python-setuptools doesn't show this problem.

So a workaround is to remove python-setuptools and install it again.

Revision history for this message
Michael Bienia (geser) wrote :

Upon further inspection the problem seems to be:

With python-setuptools 0.6c9-0ubuntu5 /usr/lib/python2.6/dist-packages/setuptools.egg-info/ is a directory and contains symlinks to the shared files.
With python-setuptools 0.6.8-1ubuntu1 /usr/lib/python2.6/dist-packages/setuptools.egg-info/ is a symlink to a file.

But the upgrade leaves only a empty directory causing the problem.

Revision history for this message
Michael Bienia (geser) wrote :

distribute (0.6.8-1ubuntu2) lucid; urgency=low

  * python-setuptools.preinst (lp: #490731):
    Remove old .egg-info directories so we can transition to symlinks.

 -- Michael Bienia <email address hidden> Sat, 05 Dec 2009 13:20:47 +0100

Successfully tested with upgrade paths:
- 0.6c9-0ubuntu5 → 0.6.8-1ubuntu2
- 0.6c9-0ubuntu5 → 0.6.8-1ubuntu1 → 0.6.8-1ubuntu2

Tested with: python-setuptools is installed and 'python -c "import pkg_resources"' succeeds.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Ack. Looks good to me.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package distribute - 0.6.8-1ubuntu2

---------------
distribute (0.6.8-1ubuntu2) lucid; urgency=low

  * python-setuptools.preinst (lp: #490731):
    Remove old .egg-info directories so we can transition to symlinks.
 -- Michael Bienia <email address hidden> Sat, 05 Dec 2009 13:20:47 +0100

Changed in distribute (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
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.