ImportError when importing Flask WTF forms
flask, python, python-3.x, wtforms
Solution
According to the official quickstart, `flask.ext.wtf` should be `flask_wtf`.
So you have to import it as:
from flask_wtf import FlaskForm
At least I have, I installed from pip.
Problem
I can't see where I'm going wrong. I have the latest WTF forms installed but I still get this error. Method: ``` from flask.ext.wtf import Form from wtforms import PasswordField, validators, fields from wtforms.fields import TextField, BooleanField from wtforms.validators import Required, Email, EqualTo ``` Result: ``` Traceback (most recent call last): File "/bin/user_wsgi_wrapper.py", line 67, in __call__ self.error_log_file.logger.exception("Error running WSGI application") File "/usr/lib/python3.3/logging/__init__.py", line 1269, in exception self.error(msg, *args, **kwargs) File "/usr/lib/python3.3/logging/__init__.py", line 1262, in error self._log(ERROR, msg, args, **kwargs) File "/usr/lib/python3.3/logging/__init__.py", line 1368, in _log self.handle(record) File "/usr/lib/python3.3/logging/__init__.py", line 1377, in handle if (not self.disabled) and self.filter(record): File "/usr/lib/python3.3/logflask_wtf wtformsging/__init__.py", line 687, in filter for f in self.filters: File "/bin/user_wsgi_wrapper.py", line 59, in __call__ app_iterator = self.app(environ, start_response) File "/bin/user_wsgi_wrapper.py", line 73, in import_error_application raise e File "/bin/user_wsgi_wrapper.py", line 82, in <module> application = load_wsgi_application() File "/bin/user_wsgi_wrapper.py", line 78, in load_wsgi_application return __import__(os.environ['WSGI_MODULE'], globals(), locals(), ['application']).application File "/var/www/rcham_pythonanywhere_com_wsgi.py", line 16, in <module> from addressbook.app import app as application File "/home/rcham/mysite/addressbook/app.py", line 4, in <module> from addressbook.forms import LoginForm, ContactsForm File "/home/rcham/mysite/addressbook/forms.py", line 1, in <module> from flask.ext.wtf import Form File "/usr/local/lib/python3.3/dist-packages/flask/exthook.py", line 87, in load_module raise ImportError('No module named %s' % fullname) ImportError: No module named flask.ext.wtf ``` ``` ls /home/rcham/.local/lib/python2.7/site-packages/flask __init__.py blueprints.py debughelpers.py globals.pyc logging.pyc signals.pyc views.py __init__.pyc blueprints.pyc debughelpers.pyc helpers.py module.py templating.py views.pyc _compat.py config.py ext helpers.pyc module.pyc templating.pyc wrappers.py _compat.pyc config.pyc exthook.py json.py sessions.py testing.py wrappers.pyc app.py ctx.py exthook.pyc json.pyc sessions.pyc testing.pyc app.pyc ctx.pyc globals.py logging.py signals.py testsuite ls /usr/local/lib/python3.3/dist-packages/ | grep wtf flask_wtf wtforms ```