multiprocessing using pathos ModuleNotFoundError: No module named pathos.helpers.mp

528 Views Asked by At

I wanted an alternative for multiprocessing and came across pathos I dug more and got one answer where the Author had provided code to user multiprocess.Process. But, I am getting the following error:

ModuleNotFoundError: No module named 'pathos.helpers.mp'

for code:

import pathos.helpers.mp.Process as prc

Also, When I used

from multiprocess.process import BaseProcess

I am getting the following error in p.start():

self._popen = self._Popen(self)

TypeError: _Popen() takes 1 positional argument but 2 were given

I have tried installing from pip as well as from git using setup.py file, both the ways I am getting this error. I could have commented my problem in that problem thread only but I don't have 50 reputations.

1

There are 1 best solutions below

0
On

mp is not a module inside the pathos , hence import pathos.helpers.mp.Process won't work.

you can do it this way:

from pathos.helpers import mp

and call:

mp.Process(target=foo, args=(x, y)).start()