程式:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return "Hello, World! (PYTHON+FLASK)"
if __name__ == '__main__':
app.run(debug=True)
錯誤:
Traceback (most recent call last):
File "flask.py", line 2, in <module>
from flask import Flask
File "C:\Users\ericc\Downloads\flask.py", line 2, in <module>
from flask import Flask
ImportError: cannot import name 'Flask' from partially initialized module 'flask' (most likely due to a circular import) (C:\Users\ericc\Downloads\flask.py)
(有pip3 install flask
)