maxcountryman / flask-bcrypt

Flask-Bcrypt is a Flask extension that provides bcrypt hashing utilities for your application.

Home Page:http://readthedocs.org/docs/flask-bcrypt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ImportError: No module named bcrypt._bcrypt In GAE

imtiaz-emu opened this issue · comments

bcrypt is required to use Flask-Bcrypt
ERROR 2016-11-10 09:07:35,749 wsgi.py:263]
Traceback (most recent call last):
File "/home/emu/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/home/emu/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "/home/emu/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject
obj = import(path[0])
File "/home/emu/GCP/gcp-bcrypt/main.py", line 5, in
from flask.ext.bcrypt import Bcrypt
File "/home/emu/GCP/gcp-bcrypt/lib/flask/exthook.py", line 81, in load_module
reraise(exc_type, exc_value, tb.tb_next)
File "/home/emu/GCP/gcp-bcrypt/lib/flask_bcrypt.py", line 27, in
raise e
ImportError: No module named bcrypt._bcrypt

I've create a Google App Engine project. And add Flask-Bcrypt in my requirements.txt file. Then install the dependencies in my project lib folder. When I run the project this gives me above error. But my Flask module which is also a 3rd party library works fine.
What's the solution? I'm using Python 2.7

I also have this problem, any solutions?

I have the same issue , I'm using python3 , flask-restful and wanted to use flask_bcrypt to hash users passwords stored in database, when I run the solution by python3 app.py, everything works perfectly and I can hash the passwords and validate them , but when I run the solution through uwsgi
uwsgi uwsgi.ini

I get internal server error when I try to authenticate.

When I review the log file , I get the following error:
from flask_bcrypt import Bcrypt ,check_password_hash ImportError: No module named 'flask_bcrypt' unable to load app 0 (mountpoint='') (callable not found or import error) . Although I can import it successfully from command line as well.

I tried to do one solution suggested in :

No module named 'flask_bcrypt'

and to add "#@UnresolvedImport" to import but still didn't work.

i have the same problem

I think this is related to bcrypt not being pure python, so it's not compatible with gae:
https://stackoverflow.com/questions/23482258/how-to-use-bcrypt-on-google-app-engine-gae