I am trying to install the GSSAPI module through pip but I receive this error that I don't know how to resolve.
Could not find main GSSAPI shared library. Please try setting GSSAPI_MAIN_LIB yourself or setting ENABLE_SUPPORT_DETECTION to 'false'
I need this to work on Python 2.6 for LDAP3 authentication.
Summary, for the impatient
And now the details...
I have a Debian system that uses Heimdal Kerberos. I'll take you through what I had to do to get it working for me. Hopefully, this can help someone else as well.
Problem 1 - krb5-config: command not found
setup.py
for gssapi uses thekrb5-config
command to find the GSSAPI library to link against (see here). Because my system was installed using Heimdal instead of MIT Kerberos, the executable command has been renamed tokrb5-config.mit
sosetup.py
misses it.I created a symlink to get it to work for the install:
Problem 2 - libgssapi_krb5.so: cannot open shared object file: No such file or directory
setup.py
is looking in/usr/lib
for the gssapi library to link against. In Debian Jesse, most libs are now kept in/usr/lib/x86_64-linux-gnu
. Again, a symlink can fix this:Problem 3 - error: unknown type name ‘gss_key_value_set_desc’
The build fails because it does not recognize a symbol in the library. The reason for this is that it was not able to get the right header file. Silly me, I forgot to include the
-dev
package for krb5 headers. Fix this with apt-get:Finally - Install gssapi
Now we should be all ready to go.
If you want to tidy up, you can remove the symlink to the
krb5-config.mit
command: