gpt4 book ai didi

python - ImportError ('No module named %s' % fullname) ImportError : No module named flask. ext.wtf.TextField

转载 作者:太空宇宙 更新时间:2023-11-04 05:54:40 26 4
gpt4 key购买 nike

这是我的错误信息

Traceback (most recent call last):   File "app.py", line 9, in
<module>
from forms import ContactForm File "/home/wdgzephy/zephy-Web/forms.py", line 1, in <module>
from flask.ext.wtf import Form, TextField, TextAreaField, SubmitField, validators, ValidationError File
"/home/wdgzephy/zephy-Web/venv/local/lib/python2.7/site-packages/flask/exthook.py",
line 87, in load_module
raise ImportError('No module named %s' % fullname) ImportError: No module named flask.ext.wtf.TextField

你能帮我解决这个错误吗?我的错误是什么?

最佳答案

你必须导入wtforms(对于flask 0.9.0及以上版本):

from flask.ext.wtf import Form

from wtforms import TextField, TextAreaField, SubmitField
from wtforms.validators import Required

关于python - ImportError ('No module named %s' % fullname) ImportError : No module named flask. ext.wtf.TextField,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28472092/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com