ImportError: No module named flask.ext.mysql

Be sure that you install Flask-MySQL:

$ pip install flask-mysql

commenter, meta


I had the same problem, so I installed flask-mysql using:

$ pip install flask-mysql

and the module name is flaskext.mysql


It's flaskext, so...

Change

from flask.ext.mysql import MySQL

to

from flaskext.mysql import MySQL

Here is the official Flask-MySQL documentation: https://flask-mysql.readthedocs.org/en/latest/# You'll find that the current import syntax is as follows:

from flaskext.mysql import MySQL