Import flask not working despite installing flask

huangapple go评论57阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年6月19日 08:56:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/76503076.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定