Error 'module' object has no attribute "_extension_registry" when cPickle is imported from an installed Python 2.7.1

Gabriel Genellina gagsl-py2 at
Wed Sep 28 01:52:55 CEST 2011

En Tue, 27 Sep 2011 06:08:54 -0300, Wong Wah Meng-R32813  
<r32813 at> escribió:

> Hello all,
> I encounter this issue whereby I am not able to load cPickle module into  
> the python I newly built. There is no issue when I load it right from  
> the folder where the python executable and is built.  
> However, it gives me this error when I load the same module using the  
> installed files (python and all its modules, shared library from default  
> /use/local folder that contains bin, lib, include sub-folders) from  
> "make install" command.
> Does anyone know why? Here is the error:-
> $ python
> Python 2.7.1 (r271:86832, Sep 27 2011, 15:19:26) [C] on hp-ux11
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import cPickle
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> AttributeError: 'module' object has no attribute '_extension_registry'

Looking at cPickle.c, it imports the copy_reg module and then looks for  
its "_extension_registry" attribute. Maybe your is broken, or  
you have another hiding the standard one.

Gabriel Genellina

More information about the Python-list mailing list