Answer a question

I have a flask app that uses wtforms.

I have a file which does:

from wtforms.fields.html5 import DateField, EmailField, TelField

# rest of the file

I just wanted to rebuild my docker container and now I have this error:

ModuleNotFoundError: No module named 'wtforms.fields.html5'

I have in my requirements.txt:

flask
flask-login
flask_sqlalchemy
Flask-Mail
pyodbc
requests
waitress
wtforms

I tried to add flask_WTF but it did not fix it.

Any idea what's going on? I thought of upgrading wtforms but it seems like I have the newest version:

pip install wtforms
Requirement already satisfied: wtforms in /usr/local/lib/python3.9/site-packages (3.0.0)
Requirement already satisfied: MarkupSafe in /usr/local/lib/python3.9/site-packages (from wtforms) (2.0.1)

Answers

Downgrading WTForms==2.3.3 solved the issue for me. Thread referenced here.

Logo

Python社区为您提供最前沿的新闻资讯和知识内容

更多推荐