Ошибка Dramatiq ModuleNotFoundError

#python #python-3.x #dramatiq

#python #python-3.x #dramatiq

Вопрос:

У меня есть проект со следующей структурой:

app.py

Src

__ check_health.py

__ health_checker.py

venv


health_checker.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()
 

app.py

 from src.check_health import check_health


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

Когда я пытаюсь запустить dramatiq с

 dramatiq check_health
 

ошибка повышения dramatiq:

 ModuleNotFoundError: No module named 'src'
 

что я делаю не так?

Комментарии:

1. есть ли у вас init -файл в src?

2. У вас есть опечатка: из src.health_cheker импортируйте health_checker