简体   繁体   中英

why do i get the following error even when sql alchemy is installed on the system? ModuleNotFoundError : No module named 'flask_sqlalchemy'

from flask import Flask, redirect, url_for, render_template
from flask_sqlalchemy import SQLAlchemyapp = Flask(__name__)
db = SQLAlchemy(app)
class error_db(db.model):
    Zendesk_Ticket_No = db.Column(db.Integer, primary_key = True)
    Client_Name = db.column(db.String(120))
    Carrier_Name = db.column(db.String(120))
    Number_of_Records = db.column(db.String(120))
    Plan_Type = db.column(db.String(120))
    Manual_or_Macro_Error_Type = db.column(db.String(120))
    System_Bug = db.column(db.String(120))
    To_be_corrected_end = db.column(db.String(120))
    Status = db.column(db.String(120))
    EDI_File_Date = db.column(db.String(120))
    Received_Date = db.column(db.String(120))
    Completed_Date = db.column(db.String(120))
    Next_EDI_File_Due_Date = db.column(db.String(120))
    Comment = db.column(db.String(120))
    File_Worked_Upon_By = db.column(db.String(120))
    Month = db.column(db.String(120))
@app.route("/")
def home():
    return render_template("index.html")if __name__ == "__main__":
    db.create_all()
    app.run()

when i run this code i get the error as ModuleNotFoundError: No module named 'flask_sqlalchemy', when i try pip install sqlalchemy, it is shown requirement already satisfied.

did u use pip install Flask-SQLAlchemy ? SQLAlchemy is different to Flask-SQLAlchemy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM