Question regarding multiprocessing and error: Can't pickle <type

Discussion in 'Python' started by tleeuwenburg@gmail.com, Oct 14, 2009.

  1. Guest

    Hi all,

    Thanks in advance for any suggestions. I'm getting the following:

    Exception in thread Thread-1:
    Traceback (most recent call last):
    File "/work/tjl/apps/lib/python2.6/threading.py", line 525, in
    __bootstrap_inner
    self.run()
    File "/work/tjl/apps/lib/python2.6/threading.py", line 477, in run
    self.__target(*self.__args, **self.__kwargs)
    File "/work/tjl/apps/lib/python2.6/multiprocessing/pool.py", line
    225, in _handle_tasks
    put(task)
    PicklingError: Can't pickle <type 'instancemethod'>: attribute lookup
    __builtin__.instancemethod failed


    The code block which calls this is:


    def processGrids(self, grids):
    '''
    Get each grid within the time range and initiate processing
    for each grid
    '''

    numberOfGrids = float(len(grids))


    import multiprocessing, functools
    pool = multiprocessing.Pool(processes=2)

    pool.map(self.processSingleGrid, [(grid, index, grids) for
    index, grid in enumerate(grids)])
     
    , Oct 14, 2009
    #1
    1. Advertising

  2. Tennessee Guest

    I have found a way around my problem.

    -Tennessee
     
    Tennessee, Oct 14, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. a pickle's pickle

    , Aug 2, 2005, in forum: Python
    Replies:
    4
    Views:
    393
  2. Michele Simionato
    Replies:
    2
    Views:
    1,909
    Michele Simionato
    May 23, 2008
  3. Abhinav M Kulkarni

    Advice regarding multiprocessing module

    Abhinav M Kulkarni, Mar 11, 2013, in forum: Python
    Replies:
    0
    Views:
    111
    Abhinav M Kulkarni
    Mar 11, 2013
  4. Dave Angel
    Replies:
    0
    Views:
    112
    Dave Angel
    Mar 11, 2013
  5. Abhinav M Kulkarni

    Re: Advice regarding multiprocessing module

    Abhinav M Kulkarni, Mar 11, 2013, in forum: Python
    Replies:
    0
    Views:
    128
    Abhinav M Kulkarni
    Mar 11, 2013
Loading...

Share This Page