I was getting PicklingError: Can't pickle <type 'obj'>
while using multiprocessing so I switched from multiprocessing to pathos.
My code looks like this:
from pathos.multiprocessing import ProcessingPool as Pool
pool = Pool(processes=9)
tuples = [(session, query, parse_query, filter_values, i) for i in range(32)]
responses = pool.uimap(execute_queries, [session]*32, [query]*32,[parse_query]*32, [filter_values]*32, [i for i in range(32)] )
pool.close()
pool.join()
response = reduce(reduce_dic, responses)
Upon running the code I get the following error:
Pool not running
On one post I read that I need to clear the pool, but I am not sure how would that work for me.