AttributeError: 'module' object has no attribute 'pack'

Ben Kaplan bsk16 at case.edu
Thu Sep 10 19:45:41 EDT 2009



On Sep 10, 2009, at 4:21 PM, Sampsa Riikonen <sampsa.riikonen at iki.fi>  
wrote:

> Hello,
>
> I already solved this.. I had to set
>
> PYTHONPATH=
>
> After that the error msg disappeared.
> Weird though.. I don't have any module called "subprocess"
> in my personal python modules directory.
>
> Anyway, thanks for the swift reply!
>
> Regards,
>
> Sampsa


Acually, it looks like the offending module is struct which is called  
by pickle which is called by subprocess. Do you have a struct.py?
>
>
> On Thursday 10 September 2009 10:40:11 pm Albert Hopkins wrote:
>> On Thu, 2009-09-10 at 21:07 +0300, Sampsa Riikonen wrote:
>>> Dear List,
>>>
>>> I have a freshly installed opensuse 11.2 and I am experiencing the
>>> following problem with the module "subprocess":
>>>
>>> sampsa at linux-912g:~> python
>>> Python 2.6 (r26:66714, Feb  3 2009, 20:52:03)
>>> [GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
>>> Type "help", "copyright", "credits" or "license" for more  
>>> information.
>>>
>>>>>> import subprocess
>>>
>>> Traceback (most recent call last):
>>>  File "<stdin>", line 1, in <module>
>>>  File "/usr/lib/python2.6/subprocess.py", line 404, in <module>
>>>    import pickle
>>>  File "/usr/lib/python2.6/pickle.py", line 171, in <module>
>>>    class Pickler:
>>>  File "/usr/lib/python2.6/pickle.py", line 250, in Pickler
>>>    def put(self, i, pack=struct.pack):
>>> AttributeError: 'module' object has no attribute 'pack'
>>>
>>> Any ideas how to fix this?
>>>
>>> Kind Regards,
>>
>> Is there another struct module that is overriding the built-in one?
>>
>>>>> import struct
>>>>> struct.__file__
>
>
> -- 
> http://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list