본문 바로가기

language/파이썬

[python] flask 오류

Traceback (most recent call last):
  File "C:\Users\minchan\python\flask.py", line 1, in <module>
    from flask import Flask
  File "C:\Users\minchan\python\flask.py", line 1, in <module>
    from flask import Flask
ImportError: cannot import name 'Flask' from partially initialized module 'flask' (most likely due to a circular import)

 

파일명을 flask로 하면 안 된다

 

https://stackoverflow.com/questions/61032702/importerror-cannot-import-name-flask-from-partially-initialized-module-flask

 

ImportError: cannot import name 'Flask' from partially initialized module 'flask' (most likely due to a circular import)

from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return "Hello, World!"

stackoverflow.com