【发布时间】:2019-05-10 13:53:58
【问题描述】:
我正在运行一个 dask 集群和一个 worker w。使用 CLI 实用程序的 16 个内核。 总的来说,它似乎工作得很好。 但是,由于某种原因,它不会在 cwd 中导入模块。 我尝试从我的笔记本实例中运行以下命令:
def tstimp():
import os
return os.listdir()
c.run(tstimp)
我得到以下输出:
{'tcp://192.168.1.90:35885': ['class_positions.csv',
'.gitignore',
'README.md',
'fullrun.ipynb',
'.git',
'rf.py',
'__pycache__',
'dask-worker-space',
'utils.py',
'.ipynb_checkpoints']}
请注意,此处列出了模块 rf.py。 因此应该可以在worker中导入它,但是当我运行以下代码时:
def tstimp():
import rf
return 42
c.run(tstimp)
我收到此错误:ModuleNotFoundError: No module named 'rf'
为什么会出现这个错误?
【问题讨论】:
标签: python-3.x parallel-processing cluster-computing dask dask-distributed