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

2011-09-27 Thread Wong Wah Meng-R32813
Thanks Gabriel,

Indeed, there is corrupted copy_reg.py file residing in my $PYTHONPATH folder, 
as opposed to the standard one from the installed package. Thanks a lot for 
your helps!

Regards,
Wah Meng

-Original Message-
From: python-list-bounces+wahmeng=freescale@python.org 
[mailto:python-list-bounces+wahmeng=freescale@python.org] On Behalf Of 
Gabriel Genellina
Sent: Wednesday, September 28, 2011 7:53 AM
To: python-list@python.org
Subject: Re: Error 'module' object has no attribute "_extension_registry" when 
cPickle is imported from an installed Python 2.7.1

En Tue, 27 Sep 2011 06:08:54 -0300, Wong Wah Meng-R32813  
 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 "", line 1, in 
> 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

-- 
http://mail.python.org/mailman/listinfo/python-list


-- 
http://mail.python.org/mailman/listinfo/python-list


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

2011-09-27 Thread Gabriel Genellina
En Tue, 27 Sep 2011 06:08:54 -0300, Wong Wah Meng-R32813  
 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 "", line 1, in 
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

--
http://mail.python.org/mailman/listinfo/python-list


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

2011-09-27 Thread Wong Wah Meng-R32813
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 "", line 1, in 
AttributeError: 'module' object has no attribute '_extension_registry'



-- 
http://mail.python.org/mailman/listinfo/python-list