Python and C Dependencies
Last updated 15 November 2017
When deploying Python applications to Heroku, most requested packages install properly and work as expected. However, some packages require obscure C dependencies — and do not ship
manylinux wheels — that are not supported by Heroku at this time.
Scientific Python Users
If your application utilizes obscure dependencies (scikit-learn, etc), you can use this example application as an easy starting place to deploy your application to Heroku today, utilizing the power of our Docker Container Registry support and Continuum’s powerful Miniconda package manager:
GeoDjango Application Libraries
If your application requires geo libraries, experimental support for a handful of these libraries are available:
- GDAL v2.2.1 (v1.11.5 for cedar-14)
- Geos v3.6.2 (v3.4.2 for cedar-14)
- Proj v4.9.3 (v4.8.0 for cedar-14)
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
Note: This feature is only known to work well on
cedar-14. We are working to ensure that it works properly on
During your next build, these libraries will be downloaded and installed.
In your Django
settings.py, also add the following:
import dj_database_url DATABASES['default'] = dj_database_url.config() DATABASES['default']['ENGINE'] = 'django.contrib.gis.db.backends.postgis' GDAL_LIBRARY_PATH = os.getenv('GDAL_LIBRARY_PATH') GEOS_LIBRARY_PATH = os.getenv('GEOS_LIBRARY_PATH')
This will ensure that Django can find the GEOS libraries that are installed.