I am writing a program that calls a function several times, each intended to be run simultaneously over the course of hours. It’s my first attempt at multiprocessing, and it’s evident from looking at other similar threads here that I need to read up on the process of “pickling”. However, if I’m missing something simple here I’m hoping someone could get me past this.
The error:
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object '_createenviron.<locals>.encodekey'
Excuse my language but there seems to be a problem with the forking pickler.
Here’s a simplified representation of the code that has me in a pickle:
def run_runner(date, info):
do stuff
processes = []
for t in range(len(sites)):
process = Process(target = run_runner, args=[date, info[t]])
processes.append(process)
process.start()
for p in processes:
p.join()
Thanks.