How to use a module using multiprocessing on windows?

the module is wrote for linux so it doesnt have " if name == ‘main’: " check orignially, and can worked well on linux
but on windows “spawn” instead of “fork”, a runtime error occurs
and the " if name == ‘main’: " check is INVALID since the module is IMPORTED to the main entry file
what should i do with it? ty

You can put the statement that imports the module inside the if __name__ == '__main__': guard of the main entry script.

1 Like

that worked for me, ty for help

1 Like