Forums

ImportError: cannot import name AnonymousUserMixin

Guys and girls,

I put the following in flask_app.py ... from flask.ext.security import Security

Got an error to say module not found, so assumed it wasnt installed. Tried to install via "pip install flask-security" Got an install error there, so did "pip install --user flask-security" ie with user switch, install ok - but now when viewing page, I get ...

File "/bin/user_wsgi_wrapper.py", line 136, in import_error_application raise e ImportError: No module named flask.ext.security

Any help? thanks

Is your web app a Python 2.7 one? pip on its own installs for Python 2.7, if you're using a different Python version you need to use pip3.3 or pip3.4 as appropriate.