1

我有下一个结构的项目:

应用程序.py

源代码

__ check_health.py

__ health_checker.py

venv


健康检查器.py

import requests


def health_checker():
    host = 'http://172.22.19.244:49250/api/v1/health'
    response = requests.get(host).json()
    print(response)

check_health.py

from src.health_cheker import health_checker
import dramatiq

@dramatic.actor
def check_health():
    health_checker()

应用程序.py

from src.check_health import check_health


if __name__ == '__main__':
    check_health.send()

当我尝试开始戏剧时

dramatiq check_health

戏剧引发错误:

ModuleNotFoundError: No module named 'src'

我做错了什么?

4

0 回答 0