由于jinja2属于第三方模块,首先需要对其进行安装 1 pip3 install jinja2 测试模板是否安装成功 1 2 3 4 python -c "import jinja2" Python模块学习 - jinja2 - Dahlhin - 博客园