[Distutils] Install egg from SVN sources => AttributeError: 'module' object has no attribute '__getstate__'

Eemeli Kantola eemeli.kantola at iki.fi
Fri Dec 18 14:23:47 CET 2009


2009/12/18 P.J. Eby <pje at telecommunity.com>:
> At 06:10 PM 12/17/2009 +0200, Eemeli Kantola wrote:
>>
>> Hi all,
>>
>> I'm getting a crash in setuptools-0.6c11-py2.6 when trying to install
>> an egg directly from SVN sources. This happens both on OSX and Ubuntu,
>> versions:
>>
>> Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51) [GCC 4.2.1 (Apple
>> Inc. build 5646)] on darwin
>> Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) [GCC 4.3.3] on
>> linux2
>>
>> Command and stack trace:
>> ...
>>
>> So is this a bug? My fix is presumably only treating the symptoms,
>> because I've got only little clue of what is happening in the code...
>
> My guess is that you've got some other pkg_resources module on your
> sys.path, such as from an older version of setuptools.
>
> Could you check the following from your Python prompt?
>
>>>> import pkg_resources, setuptools
>>>> print pkg_resources.__file__
>>>> print setuptools.__file__
>>>> print setuptools.__version__

Yes, thank you! Probably that was it, because after reinstalling
setuptools 0.6c11, the problem went magically away. On OSX, setuptools
was clearly somehow broken, but on Ubuntu side, there seemed to be no
obvious problems before reinstalling:

>>> import pkg_resources, setuptools
>>> print pkg_resources.__file__
/usr/local/lib/python2.6/dist-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py
>>> print setuptools.__file__
/usr/local/lib/python2.6/dist-packages/setuptools-0.6c11-py2.6.egg/setuptools/__init__.py
>>> print setuptools.__version__
0.6c11

Anyway, problem solved.

> Thanks.

Best,
-Eemeli


More information about the Distutils-SIG mailing list