Flask 和 Jinja2 之间的版本对应关系在 Flask 安装时会告诉你它支持的 Jinja2 版本。
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| > pip install flask==0.12.1 Collecting flask==0.12.1 Downloading Flask-0.12.1-py2.py3-none-any.whl (82 kB) |████████████████████████████████| 82 kB 105 kB/s Requirement already satisfied: click>=2.0 in c:\env\python\python368\lib\site-packages (from flask==0.12.1) (8.0.4) Requirement already satisfied: itsdangerous>=0.21 in c:\env\python\python368\lib\site-packages (from flask==0.12.1) (2.0.1) Requirement already satisfied: Jinja2>=2.4 in c:\env\python\python368\lib\site-packages (from flask==0.12.1) (3.0.3) Requirement already satisfied: Werkzeug>=0.7 in c:\env\python\python368\lib\site-packages (from flask==0.12.1) (0.16.1) Requirement already satisfied: importlib-metadata in c:\env\python\python368\lib\site-packages (from click>=2.0->flask==0.12.1) (4.8.3) Requirement already satisfied: colorama in c:\env\python\python368\lib\site-packages (from click>=2.0->flask==0.12.1) (0.4.5) Requirement already satisfied: zipp>=0.5 in c:\env\python\python368\lib\site-packages (from importlib-metadata->click>=2.0->flask==0.12.1) (3.6.0) Requirement already satisfied: typing-extensions>=3.6.4 in c:\env\python\python368\lib\site-packages (from importlib-metadata->click>=2.0->flask==0.12.1) (3.10.0.2)
Successfully installed flask-0.12.1
|
以下是一些常见的版本组合:
- Flask 2.0.x 推荐使用 Jinja2 3.0.x
- Flask 1.1.x 可以与 Jinja2 2.11.x 兼容
- Flask 1.0.x 可以与 Jinja2 2.10.x 兼容
你可以在 PyPI 上查看 Flask 的页面,并查看它依赖的 Jinja2 版本:
https://pypi.org/project/Flask/
https://pypi.org/project/Flask/#history
或者,你可以在 Jinja2 的 GitHub 仓库中查看 release notes:
https://github.com/pallets/jinja/releases