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

ImportError: No module named bcrypt._bcrypt In GAE #41

Open
imtiaz-emu opened this issue Nov 10, 2016 · 4 comments
Open

ImportError: No module named bcrypt._bcrypt In GAE #41

imtiaz-emu opened this issue Nov 10, 2016 · 4 comments

Comments

@imtiaz-emu
Copy link

imtiaz-emu commented Nov 10, 2016

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

@bw4sz
Copy link

bw4sz commented Jul 22, 2017

I also have this problem, any solutions?

@ButeForce
Copy link

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.

@MaHmoudAlmoKdaD
Copy link

i have the same problem

@alanhamlett
Copy link
Collaborator

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

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

5 participants