Skip to content
This repository has been archived by the owner on May 12, 2020. It is now read-only.

ImportError: cannot import name 'SQLALchemy' from 'flask_sqlalchemy' #71

Open
Sanidhya-Tyagi opened this issue Mar 23, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@Sanidhya-Tyagi
Copy link

Sanidhya-Tyagi commented Mar 23, 2020

i m running this code
`from flask import Flask, render_template, url_for
from flask_sqlalchemy import SQLALchemy
from datetime import datetime

app = Flask(name)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.db'
db = SQLALchemy(app)

class Todo(db.Model):
id = db.Column(db.Integer, primary_key=True)
content = db.Column(db.Integer, default = 0)
data_created = db.Column(db.datetime, default=datetime.utcnow)

def __repr__(self):
    return '<Task %r>' % self.id

@app.route("/")
def index():
return render_template("index.html")

if name == "main":
app.run(debug=True)`

and when i run it

ImportError: cannot import name 'SQLALchemy' from 'flask_sqlalchemy' (c:\users(My User)\onedrive\documents\flask\env\lib\site-packages\flask_sqlalchemy_init_.py)

Please help #71 #62 #9

@Ampferl Ampferl added the bug Something isn't working label Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants