Huey,烧瓶:ModuleNotFoundError:没有名为“ run_huey”的模块

时间:2018-08-22 18:28:41

标签: python python-huey

enter image description here

我正在尝试使用python huey(https://github.com/coleifer/huey/blob/master/huey/api.py)来允许烧瓶使用任务队列。

从文件app.tasking.tasks开始:

s

如果我运行:

$ python ... huey_consumer.exe run_huey.huey,其中run_huey.py(项目根目录中的文件)包含:

self

我知道:

from . import my_huey
from app.main.cl import dummy_create_cl_listing, create_cl_listing
from app.main.mobiletest import some_long_calculation,create_chromedriver

create_cl_listing_task = my_huey.task()(create_cl_listing)
some_long_calculation_task = my_huey.task()(some_long_calculation)
@my_huey.task()
def dummy_create_task(messages):
    time.sleep(5)
    print('continuing..')
    time.sleep(25)
    return 'fin'

显示任务可用。但是,如果无法将已转换为任务的函数导入app.main.views文件,以便可以通过view函数调用它。例如,如果我添加:

from app.tasking.tasks import my_huey as huey
if __name__ == '__main__':
    pass

到main.views文件:

[2018-08-22 14:10:58,587] INFO:huey.consumer:MainThread:The following commands are available:
+ queue_task_create_cl_listing
+ queue_task_some_long_calculation
+ queue_task_dummy_create_task

我该如何解决?

0 个答案:

没有答案