WTForms: Install 'email_validator' for email validation support
If you take a look at wtforms/validators.py file in line 9:
import email_validator
Just install the package:
pip install email_validator
If you want it installed with wtforms
:
pip install wtforms[email]
From WTForms 2.3.0 version, the email validation is handled by an external library called email-validator
(PR #429). If you want to enable email validation support, you either need to install WTForms with extra requires email
:
$ pip install wtforms[email]
Or you can install email-validator
directly:
$ pip install email-validator
Or you can back to the old version of WTForms:
$ pip install wtforms==2.2.1
P.S. If you are using Flask-WTF, except for install email-validator
directly, you can also use email
extra (if PR #423 got merged) in the next release (> 0.14.3).
Try install
pip install email-validator
I had the same problem with the latest updates, tried to install email_validator and flask-validator and continued with this exception. Solved by adding in requirements.txt the following line: email-validator == 1.0.5 as suggested [here].(https://github.com/alphagov/notifications-admin/commit/5ce2906c5aa6d16)
Actually wtforms[email]==2.3.1 is what I need.