这是因为没有templates文件夹,因为默认情况下,Flask在程序文件夹中的templates子文件夹中寻找模板。 在程序文件夹下边新建一个templates文件夹,将index.html模板文件放进去