2

I have installed flask-sqlalchemy via pip.But something wrong happened when I run the program,that is, "cannot import name SQLALchemy"At first,I thought the problem was the improper installation.However,I still couldn't solve the problem after several uninstall and installation.Then I change the first line into "from flask_sqlalchemy import sqlalchemy" ,it became "name SQLALchemy is not defined",Still didn't work...What should I do?enter image description hereenter image description here

1
  • Please add textual context as text in the question and not as images. Thanks. Commented Aug 28, 2016 at 9:14

2 Answers 2

1

Try to run your Python interpreter and then use:

>>> from flask import Flask
>>> from flask_sqlalchemy import SQLAlchemy

this should work. Your original code has a typo

Sign up to request clarification or add additional context in comments.

1 Comment

sure, feel free to upvote and accept my answer then ;) which was the first
1

I believe that imports are case sensitive.

Try from flask_sqlalchemy import SQLAlchemy instead of SQLALchemy

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.