Import "wtforms.fields.html5" could not be resolved
2021. 11. 16. 16:08ㆍTrouble shooting/backend
Import "wtforms.fields.html5" could not be resolved
from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField, PasswordField
from wtforms.fields.html5 import EmailField
from wtforms.validators import DataRequired, Length, EqualTo, Email
class QuestionForm(FlaskForm):
subject = StringField('제목', validators=[DataRequired('제목은 필수입력 항목입니다.')])
content = TextAreaField('내용', validators=[DataRequired('내용은 필수입력 항목입니다.')])
(...)
여기서 계속
Import "wtforms.fields.html5" could not be resolved 오류가 떠서
pip install email_validator
를 하였으나 그대로 문제가 있어 고민하던 중
를 참조하여 해결하였음.
'''
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).
'''
정확히 2.2.1 버전을 요구 하였음
728x90
'Trouble shooting > backend' 카테고리의 다른 글
로그인시 쿠키, 세션 참고 (0) | 2022.02.15 |
---|---|
RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods (0) | 2021.11.16 |