No module named flask.ext.wtf No module named flask.ext.wtf flask flask

No module named flask.ext.wtf


The API has changed from:

from flask.ext.wtf import Form

to:

from flask_wtf import Form

See the docs here


You are probably using the import style from the older versions:

from flask.ext.wtf import Form, TextField, BooleanFieldfrom flask.ext.wtf import Required

The import style changed starting from 0.9.0 version. Be sure to update your imports:

from flask.ext.wtf import Formfrom wtforms.fields import TextField, BooleanFieldfrom wtforms.validators import Required

You can find the note about this change in the upgrade section of docs:

https://flask-wtf.readthedocs.org/en/latest/upgrade.html#version-0-9-0


I had the same problem. I read steps 1 again to check where I slipped.

Remember to install the necessary modules for your project.

In this case the following:

flask/bin/pip install flask-loginflask/bin/pip install flask-openidflask/bin/pip install flask-mailflask/bin/pip install sqlalchemyflask/bin/pip install flask-sqlalchemyflask/bin/pip install sqlalchemy-migrateflask/bin/pip install flask-whooshalchemy==0.55aflask/bin/pip install flask-wtfflask/bin/pip install pytzflask/bin/pip install flask-babelflask/bin/pip install flup

Since you've created this virtual environment, "flask", all the modules installed are available only in your virtual environment(flask).

Remember to run "flask/Scripts/python run.py" and not "python run.py"