multiprocessing question/error

Eduardo Lenz lenz at
Sat Jan 17 06:39:04 CET 2009


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: lenz at          

Esta mensagem foi verificada pelo sistema de antivírus e
 acredita-se estar livre de perigo.

More information about the Python-list mailing list