Closed phmarch closed 5 years ago
I'm not able to reproduce your error with a similar environment. Do you have a C compiler installed? Without a C compiler, pathos
will install fine, but may throw a warning that _multiprocess
is not installed -- that is unless you used the multiprocess
wheel upon install, which I believe pip
does for you.
The error line in the traceback raise self._value
is indicative of not having the _multiprocess
module installed (which requires the wheel or a C compiler).
Try: import _multiprocess
If that fails, you have an incomplete install of multiprocess
, and likely need a C compiler or to use the wheel of multiprocess
.
I just tried to reproduce the error and I think I understand why I got it. If I run the code I pasted by itself, it works great but if I import multiprocessing before, I get the error again.
Since I am using jupyter notebook, a single import multiprocess
will be kept in memory and will prevent me from using pathos until the notebook is reset, which is why I overlooked this detail while looking for the origin of the problem.
Somehow import _multiprocessing
works but I still get the error. I just cannot use multiprocessing and pathos in the same notebook.
I tried in a standalone python script and both of them seem to work without interfering. I guess it's a weird interaction with jupyter notebook.
Thank you
Jupyter notebooks do strange things... basically, each individual cell is kind of like an independent file... but at the end, after it executes, it dumps it's globals
into the notebook's globals
.
pathos
and multiprocess
shouldn't conflict... pathos
uses multiprocess
. Did you check import _multiprocess
or import _multiprocessing
? They are different. I meant the former. The latter is from python STL.
Note the use of both multiprocess
and pathos
in the same notebook here: https://github.com/mmckerns/tuthpc/blob/master/multiprocessing.ipynb
Oooh I found the issue. I had a multiprocess.py
file in the same folder (that I randomly named to test out pathos) and the import multiprocess
must have been importing this one instead of the library.
import _multiprocess
isn't throwing any errors so I'm sure this was the problem! Both multiprocessing
and pathos
are now working in the same notebook. Thank you
AttributeError: Can't pickle local object 'run.
AttributeError Traceback (most recent call last)
So I've been trying to get pathos to work on my windows environment and I keep getting the same error for the simple examples I found in the doc:
I get this error:
My environment:
Note that I installed pathos with
pip install pathos
and it worked fine. The dependencies are: