21

I deployed my flask application into aws beanstalk and ran into an import error:

ImportError: No module named flask.ext.sqlalchemy

In my application.py file, I have this statement

from flask.ext.sqlalchemy import SQLAlchemy

and it runs fine on my machine but does not work in aws elastic beanstalk.

Anyone ran into a similar issue?

taskinoor
  • 45,586
  • 12
  • 116
  • 142
Michael
  • 3,699
  • 4
  • 26
  • 27
  • 2
    The Flask-SQLAlchemy extension is now located at `flask_sqlalchemy`. See [the documentation](http://flask-sqlalchemy.pocoo.org/2.1/quickstart/). – franklin Jan 25 '16 at 07:02

1 Answers1

19

Make sure you have included a requirements.txt file in root directory of your project.

The file should include any pip package that needs to be installed

Flask-SQLAlchemy=1.0

http://www.pip-installer.org/en/latest/cookbook.html#requirements-files

Desmond Morris
  • 1,056
  • 1
  • 9
  • 13