PaddleCV-SIG / PaddleLabel

飞桨智能标注,让标注快人一步
https://paddlecv-sig.github.io/PaddleLabel/
Apache License 2.0
236 stars 38 forks source link

使用alembic生成创建语句报错unable to open database file【已解决】 #187

Closed andyz168 closed 1 year ago

andyz168 commented 1 year ago

数据库路径是对的,有这个数据库,并且调试能读取写入 INFO [paddlelabel.config.19]: Database path: sqlite:///C:\Users\andyz.quacheckweb\quacheckweb.db 使用下面的命令报错

cd paddlelabel
alembic revision --autogenerate -m "create train_config table"
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file
(Background on this error at: https://sqlalche.me/e/20/e3q8)
andyz168 commented 1 year ago

看到env.py 走的online ,是走离线还是在线的 但是没找到在哪里配置 config = context.config

andyz168 commented 1 year ago

尝试使用 alembic upgrade e660f34b820d --sql 走的离线模式,更新也报错了

RuntimeError: Working outside of application context.

This typically means that you attempted to use functionality that needed
the current application. To solve this, set up an application context
with app.app_context(). See the documentation for more information.
andyz168 commented 1 year ago

看到env.py 走的online ,是走离线还是在线的 但是没找到在哪里配置 config = context.config

找到问题了,使用命令sqlalchemy.url 读取的文件地址是paddlelabel/alembic.ini该文件配置的sqlalchemy.url 这个地址是没改的, 但是程序运行的时候不是取这里,所以运行程序或者调试的时候是看不出问题。

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.