python – Error running concurrent.futures.ProcessPoolExecutor

I’m a new user of concurrent.futures.ProcessPoolExecutor. While trying a simple script, I faced a problem running the script in IDLE and through the windows cmd. Surprisingly, the script works using online interpreters like “”. The script is,

import concurrent.futures
def func(a):
return a**2
A = ()
with concurrent.futures.ProcessPoolExecutor(2) as executor:
    result =,range(10))
    for r in result:

The Error is,

Traceback (most recent call last):
  File "", line 8, in <module>
    for r in result:
  File "", line 483, in _chain_from_iterable_of_lists
    for element in iterable:
  File "", line 598, in result_iterator
    yield fs.pop().result()
  File "", line 435, in result
    return self.__get_result()
  File "", line 384, in __get_result
    raise self._exception
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.

I would appreciate it if someone could help me with the problem.