I have recently worked on a project that used Python 3 and Flask – a Python micro-framework and while deploying the application into staging, one of the errors that I have encountered was installing flask-bcrypt extension which get stuck when installing bcrypt and cffi (c foreign function interface). The server is running Ubuntu Linux 14.04 Trusty LTS and Python 3.

Anyway, here’s how to fix the above error.

1. Make sure to update your repository list to latest

sudo apt-get update

2. When update is finished, install the following packages, python-dev if you are using python2

sudo apt-get install build-essential libssl-dev libffi-dev python3-dev

3. Install flask-bcrypt
sudo pip3 install flask-bcrypt

That’s it, you should have flask-bcrypt extension installed already. To use flask-bcrypt, follow this link for usage documentation.

Leave a Reply

Your email address will not be published. Required fields are marked *