Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Windows中的烧瓶错误消息_Python_Flask - Fatal编程技术网

Python Windows中的烧瓶错误消息

Python Windows中的烧瓶错误消息,python,flask,Python,Flask,这是我的代码片段 from flask import Flask, render_template, request, flash from forms import ContactForm from flask.ext.mail import Message, Mail 我得到这个错误消息() 我如何解决这个问题,因为我认为forms.py和flask.ext不是一个模块 我安装了我的程序要使用的每个模块 将从flask.ext.mail导入消息,mail更改为从flask\u mail导

这是我的代码片段

from flask import Flask, render_template, request, flash
from forms import ContactForm
from flask.ext.mail import Message, Mail
我得到这个错误消息()

我如何解决这个问题,因为我认为forms.py和flask.ext不是一个模块


我安装了我的程序要使用的每个模块

从flask.ext.mail导入消息,mail
更改为
从flask\u mail导入消息,mail

请参考有关如何使用/导入扩展的文档:。和
flask email
()和
flask wtf
()文档

编辑


在flask\forms.py的
intro to flask\forms.py中,将
从flask.ext.wtf import…
更改为
从flask\u wtf import…

请将控制台输出(错误消息)也粘贴为文本(而不是图片)。好的,谢谢。现在我得到一个名为“flask\u ext\u wtf”的无模块@ferencekovacs编辑。好的,酷!!:D它从版本0.9.0开始工作,Flask WTF不会从wtforms导入任何内容,您需要从wtforms导入字段。