Python 3.10.4 + Win
sphawkcn opened this issue · 1 comments
PS D:\Projects\PrimarySchoolMathematics-flask-PSM> flask run
Traceback (most recent call last):
File "C:\Users\chenbing\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in run_module_as_main
return run_code(code, main_globals, None,
File "C:\Users\chenbing\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\chenbing\AppData\Local\Programs\Python\Python310\Scripts\flask.exe_main.py", line 4, in
File "C:\Users\chenbing\AppData\Local\Programs\Python\Python310\lib\site-packages\flask_init.py", line 14, in
from jinja2 import escape
ImportError: cannot import name 'escape' from 'jinja2' (C:\Users\chenbing\AppData\Local\Programs\Python\Python310\lib\site-packages\jinja2_init.py)
推荐创建一个全新的python环境,python版本3.8就好.
其他库类:
`pip list
Package Version
autopep8 1.5.7
certifi 2020.12.5
click 7.1.2
Flask 1.1.2
itsdangerous 1.1.0
Jinja2 2.11.3
lxml 4.6.3
MarkupSafe 1.1.1
pip 21.0.1
pycodestyle 2.7.0
python-docx 0.8.10
python-dotenv 0.17.1
setuptools 52.0.0.post20210125
toml 0.10.2
Werkzeug 1.0.1
wheel 0.36.2`
你这个提示有可能是flask或是jinja2的版本过高造成.