0

I have a simple multiprocessing code

from multiprocessing import Pool

def f(x):
    return x*x

if __name__ == '__main__':
    with Pool(5) as p:
        print(p.map(f, [1, 2, 3]))

This code gives same error repeated over(as given below) . Not only this, any library/function which internally calls multiprocessing module(eg-reverse_geocoder, ProcessPoolExecutor in concurrent.futures ) shows same error while ThreadPoolExecutor runs just fine!!! I am trying to run this in Pycharm, also, same code runs fine on another Pc in Pycharm Please help. Error

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\Python37\lib\multiprocessing\spawn.py", line 105, in spawn_main
    exitcode = _main(fd)
  File "C:\Program Files\Python37\lib\multiprocessing\spawn.py", line 114, in _main
    prepare(preparation_data)
  File "C:\Program Files\Python37\lib\multiprocessing\spawn.py", line 225, in prepare
    _fixup_main_from_path(data['init_main_from_path'])
  File "C:\Program Files\Python37\lib\multiprocessing\spawn.py", line 277, in _fixup_main_from_path
    run_name="__mp_main__")
  File "C:\Program Files\Python37\lib\runpy.py", line 261, in run_path
    code, fname = _get_code_from_file(run_name, path_name)
  File "C:\Program Files\Python37\lib\runpy.py", line 231, in _get_code_from_file
    with open(fname, "rb") as f:
OSError: [Errno 22] Invalid argument: 'D:\\p\\r\\i\\b\\<input>'

0 Answers0