Heroku and CFFI 2014-07-22

UPDATE: This is no longer needed, the Python buildpack will install libffi for you if cffi or cryptography is present in your requirements.txt.

CFFI is a popular Python library to call C code from Python. Some major libraries that depend on it include:

buildpack-cffi allows any of these libraries to be installed and used in Heroku applications.


First set your BUILDPACK_URL to

$ heroku config:set BUILDPACK_URL=

Create the .buildpacks config for buildpack-multi:

$ cat .buildpacks

And then create the Aptfile config for buildpack-apt:

$ cat Aptfile

Then just put the Python libraries you need in the normal requirements.txt.

If you are installing Cryptography, no additional configuration should be required.

Looking for help with Python development or operations? Check out my training and consulting services.

Back to articles