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

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Sep 27 19:52:55 EDT 2011


En Tue, 27 Sep 2011 06:08:54 -0300, Wong Wah Meng-R32813  
<r32813 at freescale.com> 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 libpython2.7.so 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 copy_reg.py is broken, or  
you have another copy_reg.py hiding the standard one.

-- 
Gabriel Genellina




More information about the Python-list mailing list