Python and C Dependencies
Last updated 15 June 2016
Table of Contents
When deploying Python applications to Heroku, most requested packages install properly and work as expected. However, some packages, like
scipy, require obscure C dependencies that are not supported by Heroku at this time.
How to install packages with obscure dependencies
There is a third-party buildpack available called the Conda buildpack, which supports most packages that have obscure C dependencies.
It isn’t as well built or maintained as the official Heroku Python Buildpack, but if you need these libraries to be available, it may suit your needs.
$ heroku buildpacks:set https://github.com/kennethreitz/conda-buildpack.git
In addition to the standard
requirements.txt file that the Python buildpack uses, it also supports a file called
conda-requirements.txt. You can place requirements in there that have obscure C dependencies and they will automatically be installed.
GeoDjango Application Libraries
If your application requires geo libraries, experimental support for a handful of these libraries are available:
- GDAL v1.11.1
- Geos v3.4.2
- Proj v4.8.0
To make these libraries available to your application, simply set the
BUILD_WITH_GEO_LIBRARIES environment variable:
$ heroku config:set BUILD_WITH_GEO_LIBRARIES=1
During your next build, these libraries will be downloaded and installed.