Python-ldap failed to install in Heroku

Heroku doesn't seem to support python-ldap. Installing pip with "python-ldap == 2.3.13" in the requirements.txt file failed with an error in Heroku:

gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION = 2.3.13 AND local-2.3.13 openldap-2.3 / include -I / usr / include / sasl -I / usr / local / include / python2.7 -c Modules /LDAPObject.c -o build / temp.linux-x86_64-2.7 / Modules / LDAPObject.o

Modules / LDAPObject.c: 18: 18: error: sasl.h: No such file or directory

Heroku doesn't seem to have the libraries needed for python-ldap, and I don't know if there is a way to install dependency libraries other than 'pip'.

What is the recommended solution to support ldap authentication in the Heroku Python / Django stack?

Your help is greatly appreciated.

+5
source share
2 answers

You can create a custom assembly package that will be used in any libraries. Take a look at https://github.com/cirlabs/heroku-buildpack-geodjango he installs the library through Curl.

+3
source

I recelntly created a heroku buildpack that supports python-ldap. It is available on my github registry .

For it to work, you only need to specify the environment variable:

heroku config:set BUILDPACK_URL=https://github.com/damgad/heroku-buildpack-python-ldap.git
+1
source

All Articles