【问题标题】:Error while importing configuration module: No module named 'app' [aerich]导入配置模块时出错:没有名为“app”的模块 [aerich]
【发布时间】:2021-10-16 05:47:15
【问题描述】:

我发现自己在玩 Python 后端,为此我使用了 fastapitortoise-orm。但是,每次更改 tortoise-orm 模型 后手动更新数据库很痛苦,所以我使用了 开箱即用的 aerich 工具,它是专门为此目的开发的。但是,我在导入时遇到了问题,而且我很累,因为我不知道自己做错了什么。

由于某种原因,在初始化迁移目录和 aerich 设置文件后,运行任何命令 f.e.
aerich migrateaerich inspectdb”向我抛出了我在标题中输入的错误:
导入配置模块时出错:没有名为“app”的模块

这是我的设置


配置包初始化文件,其中包含 aerich 所需的 TORTOISE-ORM 设置


使用aerich init -t app.config.TORTOISE_ORM命令生成的aerich设置文件

【问题讨论】:

    标签: python python-import python-packaging tortoise-orm


    【解决方案1】:

    它已在 aerich 0.5.7 版本中得到修复。

    【讨论】:

      猜你喜欢
      • 2016-07-11
      • 2020-05-27
      • 2016-12-09
      • 2021-08-28
      • 2018-12-05
      • 2021-08-16
      • 2021-05-16
      • 2019-04-12
      • 1970-01-01
      相关资源
      最近更新 更多