cannot import name 'escape' from 'jinja2' (E:\pythonVirtualEnv\Flask\flaskEnv\lib\site-packages\jinja2\__init__.py)
时间: 2023-09-01 21:07:01 浏览: 187
根据引用的信息,当执行import flask语句时,出现了ImportError: cannot import name 'escape' from 'jinja2'的错误。这个错误表明程序无法从jinja2模块中导入escape函数。根据引用的信息,解决这个问题的方法是通过重新安装jinja2模块的适当版本。引用提供了具体的解决方法:先卸载已经安装的jinja2模块,然后安装2.11.3版本的jinja2模块。这个版本已知包含了'Markup'模块,可以解决无法导入escape函数的问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [安装flask遇到cannot import name ‘escape‘ from ‘jinja2‘ 的问题](https://blog.csdn.net/ZhangUxian/article/details/126501253)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Python的Flask框架标配模板引擎Jinja2的使用教程](https://download.csdn.net/download/weixin_38654220/14864601)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [cannot import name ‘Markup‘ from ‘jinja2‘ 和No module named flask的解决办法](https://blog.csdn.net/weixin_61001459/article/details/125754248)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文