Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'flask.ext' #188

Open
nuaays opened this issue May 10, 2018 · 12 comments
Open

ModuleNotFoundError: No module named 'flask.ext' #188

nuaays opened this issue May 10, 2018 · 12 comments

Comments

@nuaays
Copy link

nuaays commented May 10, 2018

ERROR in Python3.6

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

@winterjung
Copy link

Using from flask_cache import make_template_fragment_key instead. flask.ext.___ style is deprecated.

@jpds
Copy link

jpds commented May 10, 2018

@jpds
Copy link

jpds commented May 10, 2018

Relevant: #189, #187, #185, #184, #182, #169, #166.

@Benjacho
Copy link

Use flaskext.cache

@frispete
Copy link

frispete commented Jun 4, 2018

Here's a q&d fix for the issue:

sed -i 's/flask.ext.cache/flask_cache/g' flask_cache/__init__.py flask_cache/jinja2ext.py test_cache.py docs/index.rst

@zoltan-fedor
Copy link

Use Flask-Caching instead https://github.com/sh4nks/flask-caching

@allanice001
Copy link

#192 has a pr for this

@worldwar2008
Copy link

cache.init_app(backend)

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'

Rhilip added a commit to Rhilip/PT-help that referenced this issue Aug 30, 2018
@sitthykun
Copy link

Use Flask-Caching instead https://github.com/sh4nks/flask-caching

Fix for pip3

@yangeren
Copy link

still not fixed!

@jac0x
Copy link

jac0x commented Dec 16, 2018

line33: from flask_cache import make_template_fragment_key

It works perfectly for me!
Python 3.6
Flask 1.0.2

Thank you.

@Lewiscowles1986
Copy link

@frispete suggestion worked for me mostly

sed -i 's/flask.ext.cache/flask_cache/g' flask_cache/__init__.py flask_cache/jinja2ext.py were the succeeding commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests