1
import pathos
import pathos.multiprocessing as mp
import dill
print pool.map(pow, [1,2,3,4], [5,6,7,8])
 

when i run the above code it throws a error

cannot find pathos.multiprocessing

cannot import pathos

i tried all the possible ways but i could not find any solution. I was trying to work on a developing a code which takes more than 10 inputs and process them using multiprocessing instead of waiting in queue and generates output. For that i have tried multiprocessing, but it throws pickling error, so i tried to use pathos, but it says cannot import pathos. Can any one tell me the possible solution for this???

4

3 回答 3

1

如果你已经pip安装了 (and git),你可以简单地在命令 shell(dos、bash 或类似的......不是 python 解释器)中键入以下内容:

>$ pip install setuptools
>$ pip install git+https://github.com/uqfoundation/pathos.git@master

这将安装pathos它及其对 linux 类型系统的所有依赖项。如果您使用的是 Windows,那么您将需要一个 C++ 编译器,例如 MS Visual Studio Community。如果您有以下说明conda

>$ conda install pip
>$ conda install setuptools
>$ pip install git+https://github.com/uqfoundation/pathos.git@master

这里有更详细的说明:

https://github.com/uqfoundation/pathos/issues/2

https://github.com/mmckerns/tuthpc

于 2015-10-01T01:20:59.580 回答
0

您需要安装它才能使用它。访问Pathos网站并下载:
http ://trac.mystic.cacr.caltech.edu/project/pathos/wiki/Installation

然后您可以导航到该文件夹​​并使用 Python 本身通过 shell 安装它:

python setup.py install

然后,尝试import Pathos它应该可以工作。

于 2015-09-30T14:12:16.123 回答
-1

需要安装自己使用的软件,否则无法使用。

所以,继续安装pathos。

于 2015-09-30T13:56:42.983 回答