Flask报错annot import name ‘Flask‘ from partially initialized module ‘flask

报错

# python flask.py 
Traceback (most recent call last):
  File "/root/flask.py", line 1, in 
    from flask import Flask
  File "/root/flask.py", line 1, in 
    from flask import Flask
ImportError: cannot import name 'Flask' from partially initialized module 'flask' (most likely due to a circular import) (/root/flask.py)

原因

我的原因是把运行的文件名定成了flask.py,
但是flask.py本身就是flask的module,
所以就会发生错误,
重新改为哦其他名字就好了

你可能感兴趣的:(临时问题解决,flask,python,后端)