Python multiprocessing script crashes when run in cmd but runs properly with IDLE program [closed]

I’m able to run a python script which is using multiprocessing module (also tried with concurrent.futures module but the same result) in my windows 10 machine, python 3.8.4 environment from command line.

The same script if I try to run in command line on another machine with Win 7, python 3.7.4 environment, it stops with error "Python has stopped working. Windows is checking for a solution to the problem"

Also tried with concurrent.futures in place of multiprocessing, but same result.

But if I run the same script opening with Python program installed in the machine, it runs fine.

Also if I don’t use multiprocessing and run the script only for one target (I’m using multiprocessing to copy some content from source to target in parallel), it works fine.

below is the part of the code where it has issue:
it stops at the pool.map execution.

import multiprocessing

pool = multiprocessing.Pool(processes=4)
function_list=partial(function, arguments)
pool.map(function_list, argument_list)

Source: Python-3x Questions

LEAVE A COMMENT