I\'m unable to find a module in python ,though easy_install says its already installed. Any idea how to resolve this isseue?
$ python -c \"from flaskext.sql
I faced the same problem. Turns out I forgot to install the following package:
pip install flask_sqlalchemy
After installing the package, everything worked perfectly. Hope, it helped some other noob like me.
Install Flask-SQLAlchemy with pip in your virtualenv:
pip install flask_sqlalchemy
Then import flask_sqlalchemy
in your code:
from flask_sqlalchemy import SQLAlchemy
Probably a stupid mistake; but, I experienced this problem and the issue turned out to be that "pip3 install sqlalchemy" installs libraries in user specific directories.
On my Linux machine, I was logged in as user1 executing a python script in user2's directory. I installed sqlalchemy as user1 and it by default placed the files in user1's directory. After installing sqlalchemy in user2's directory the problem went away.
try this:
from flask.ext.sqlalchemy import SQLAlchemy
I just experienced the same problem. Apparently, there is a new distribution method, the extension code is no longer stored under flaskext
.
Source: Flask CHANGELOG This worked for me:
from flask_sqlalchemy import SQLAlchemy
This code works perfectly:
import sqlalchemy
Maybe you installed the package in another version of the interpreter?
Also, like Shawley pointed out, you need to have the flask extension installed in order for it to be accessible.