Error while importing configuration module: No module named 'app' [aerich]

Viewed 229

I found myself playing with the python backend and for that I used fastapi and tortoise-orm. However, it was a pain to manually update the database after each change to the tortoise-orm models, so I used the out-of-the-box aerich tool which was specially developed for this purpose. However, I have a problem with importing and I'm exhausting because I don't know what am I doing wrong.

For some reason, after initializing the migrations directory and the aerich settings file, running any command f.e.
"aerich migrate or aerich inspectdb" throws me the error that I put in the title:
Error while importing configuration module: No module named 'app'.

Here is my setup:

config package init file that contains required TORTOISE-ORM settings for aerich
config package init file that contains required TORTOISE-ORM settings for aerich

the generated aerich settings file using aerich init -t app.config.TORTOISE_ORM command
the generated aerich settings file using aerich init -t app.config.TORTOISE_ORM command

1 Answers

It got fixed in 0.5.7 version of aerich.

Related