python中的Pathos并行处理错误

时间:2018-09-10 06:56:02

标签: python parallel-processing parallel-python

在python中尝试并行处理时,请继续获取此错误:

    An error has occured during the function import
Traceback (most recent call last):
 File "/home/runner/.site-packages/ppft/__main__.py", line 100, in 
run
    six.exec_(__fobj)
  File "<string>", line 46, in <module>
ModuleNotFoundError: No module named 'ppft.exceptions'
A fatal error has occured during the function execution
Traceback (most recent call last):
  File "/home/runner/.site-packages/ppft/__main__.py", line 109, 
in run
    __f = locals()[ppc.str_(__fname)]
KeyError: 'run_test'

这是我的代码的要旨:

from pathos.pools import ParallelPool as Pool
urls = ["https://www.baidu.com", "https://google.com/"]

def run_test(url):
    #getting and storing a bunch of JSON data from urls in here
    #content here did not produce errors when doing single process

pool =  Pool(4)
print(pool.map(run_test, urls))
pool.close() 
pool.join()

请有人可以帮助我了解错误/问题吗?

0 个答案:

没有答案