cannot import name 'mydb' from partially initialized module 'connection' in Python

前端 未结 7 1580
南笙
南笙 2021-02-19 03:15

Python 3.8 error

ImportError: cannot import name \'mydb\' from partially initialized module \'connection\' 
(most likely due to a circular import) (C:\\U
sers\         


        
7条回答
  •  猫巷女王i
    2021-02-19 03:45

    I lowered the import instead of having all imports at the top.

    db = SQLAlchemy(app)
    migrate = Migrate(app, db)
    from models import User
    

提交回复
热议问题