英文:
Import flask not working despite installing flask
问题
我遇到了错误:
"import Flask could not be resolved"
当我有以下代码时:
from Flask import Flask, render_template, request, jsonify
from chat import get_response
app = Flask(__name__)
@app.get("/")
def index_get():
return render_template("base.html")
我已经在终端中输入了"pip install flask",不太确定出了什么问题?
英文:
I get the error:
"import Flask could not be resolved"
when I have this code:
from Flask import Flask, render_template, request, jsonify
from chat import get_response
app = Flask(__name__)
@app.get("/")
def index_get():
return render_template("base.html")
I've already typed "pip install flask" in the terminal - not sure what is wrong exactly?
答案1
得分: 1
应该是:
from flask import Flask, render_template, request, jsonify
Python 区分大小写。
英文:
It should be:
from flask import Flask, render_template, request, jsonify
Python is case sensitive.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论