From 90ed2e8b9fb2115323e4c389ad655efba351d3d8 Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 10 May 2018 11:32:34 +0800 Subject: [PATCH] fix "No module named 'flask.ext'" in Python3.6 Traceback (most recent call last): File "/manage.py", line 5, in from gBlockChain import app File "/gBlockChain/__init__.py", line 116, in register_extensions(app) File "/gBlockChain/utils.py", line 39, in __deco f(*args, **kwargs) File "/gBlockChain/__init__.py", line 32, in register_extensions getattr(kw['module'].extension, 'init_app')(app) File "/gBlockChain/extensions/redis.py", line 16, in init_app super(NewCache, self).init_app(app, config_cache) File "/usr/local/lib/python3.6/site-packages/flask_cache/__init__.py", line 156, in init_app from .jinja2ext import CacheExtension, JINJA_CACHE_ATTR_NAME File "/usr/local/lib/python3.6/site-packages/flask_cache/jinja2ext.py", line 33, in from flask.ext.cache import make_template_fragment_key ModuleNotFoundError: No module named 'flask.ext' --- flask_cache/jinja2ext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_cache/jinja2ext.py b/flask_cache/jinja2ext.py index 73be6ac..6d85fe7 100644 --- a/flask_cache/jinja2ext.py +++ b/flask_cache/jinja2ext.py @@ -30,7 +30,7 @@ from jinja2 import nodes from jinja2.ext import Extension -from flask.ext.cache import make_template_fragment_key +from flask_cache import make_template_fragment_key JINJA_CACHE_ATTR_NAME = '_template_fragment_cache'