I am trying to develop a simple forum site for my udacity assignment. It is not a strict requirement to use the bcrypt for password hashing, but I'd like to do it because I also like to know how to use third party libraries which are not provided by Google.
Following instructions provided here (installing a third-party library), I have created a folder named lib, and installed bcrypt library with following command:
python -m pip install -t lib/ bcrypt
I have the lib folder automatically structred like this:
I also created an appengine_config.py file with following content, as per instructions in above manual:
# appengine_config.py
from google.appengine.ext import vendor
# add lib folder as vendor directory
vendor.add('lib')
At this point, I am unable to import the bcrypt to my scripts. The import commands I tried so far are as follows:
from lib import bcrypt
ImportError: No module named lib
import bcrypt
ImportError: No module named bcrypt._bcrypt
from lib.bcrypt import bcrypt
ImportError: No module named lib.bcrypt
What am I missing?
As Avinash Raj pointed out, and as already pointed out in referenced manual, one cannot use python libraries with c extensions. So I downloaded the py-bcrypt, it worked like a charm.
For any newbie like me who needs it, here is the steps you have to take:
pybcrypt
appengine_config.py
file, as outlined in herefrom pybcrypt import bcrypt