0

multiprocessing_pymongo_2.py

 1 year ago
source link: https://gist.github.com/saksham219/4a3b21a682ab62496b7bc35ec506dffe
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

multiprocessing_pymongo_2.py · GitHub

Instantly share code, notes, and snippets.

HI, I am facing an issue while using it, could you please help me out on fixing it.
PicklingError: Can't pickle : it's not the same object as builtins.input

PicklingError Traceback (most recent call last)
in
----> 1 result = pool.map(calculate_partial,list(chunks(document_ids,10000)))

C:\Anaconda3\lib\multiprocessing\pool.py in map(self, func, iterable, chunksize)
266 in a list that is returned.
267 '''
--> 268 return self._map_async(func, iterable, mapstar, chunksize).get()
269
270 def starmap(self, func, iterable, chunksize=None):

C:\Anaconda3\lib\multiprocessing\pool.py in get(self, timeout)
655 return self._value
656 else:
--> 657 raise self._value
658
659 def _set(self, i, obj):

C:\Anaconda3\lib\multiprocessing\pool.py in _handle_tasks(taskqueue, put, outqueue, pool, cache)
429 break
430 try:
--> 431 put(task)
432 except Exception as e:
433 job, idx = task[:2]

C:\Anaconda3\lib\multiprocessing\connection.py in send(self, obj)
204 self._check_closed()
205 self._check_writable()
--> 206 self._send_bytes(_ForkingPickler.dumps(obj))
207
208 def recv_bytes(self, maxlength=None):

C:\Anaconda3\lib\multiprocessing\reduction.py in dumps(cls, obj, protocol)
49 def dumps(cls, obj, protocol=None):
50 buf = io.BytesIO()
---> 51 cls(buf, protocol).dump(obj)
52 return buf.getbuffer()
53

PicklingError: Can't pickle : it's not the same object as builtins.input


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK