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

前端 未结 7 1581
南笙
南笙 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条回答
  • 2021-02-19 03:54

    As mentioned above, most likely you are using a code formatter which puts all the import statements at the top. Just go to settings and disable the format on save.

    Go to the file with error, correct the order of import statements and save.

    0 讨论(0)
自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题