multiprocessing question/error


Eduardo Lenz


I was using the former processing package with python 2.5 with no problems.
After switching to python 2.6.1 I am having some problems with the same code.
The problem seems to be related to the fact that I am using
with a bounded method, since it is inside a class. To clarify a little bit,
let me show some parts of the code ....

class Pygen3(self)....
def calcula(self,indiv):

def evaluate(self):
indiv = range(mult*self.popsize,(mult+1)*self.popsize)
pool = Pool(processes=nproc)
results =,indiv)

the error is the following

Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.6/", line 522, in __bootstrap_inner
File "/usr/lib/python2.6/", line 477, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/lib/python2.6/multiprocessing/", line 225, in
PicklingError: Can't pickle <type 'instancemethod'>: attribute lookup
__builtin__.instancemethod failed

Thanks for your help.


Eduardo Lenz Cardoso
Dr. Eng.
Associate Professor

State University of Santa Catarina
Department of Mechanical Engineering
89223-100 - Joinville-SC - Brasil

Tel: +55 47 4009-7971 - Fax: +55 47 4009-7940
E-mail: (e-mail address removed)


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question