How do I install the gssapi python module?

I am trying to install the GSSAPI module via pip, but I get this error, I don't know how to solve it.

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 with python 2.6 for ldap3 authentication.

+3


source to share


1 answer


Resume for the impatient

$ sudo ln -s /usr/bin/krb5-config.mit /usr/bin/krb5-config
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 /usr/lib/libgssapi_krb5.so
$ sudo apt-get install python-pip libkrb5-dev
$ sudo pip install gssapi

      


And now the details ...

I have a Debian system using Heimdal Kerberos. I'll take you through what I have to do to make it work for me. Hope this helps someone else too.


Issue 1 - krb5-config: command not found

setup.py

for gssapi uses the command krb5-config

to find the GSSAPI library for reference (see here ). Since my system was installed using Heimdal instead of MIT Kerberos, the command executable was renamed to krb5-config.mit

, so it setup.py

skips over it.

$ krb5-config --libs gssapi  # doesn't work
bash: krb5-config: command not found

      

I created a symbolic link to make it work for installation:

$ sudo ln -s /usr/bin/krb5-config.mit /usr/bin/krb5-config
$ krb5-config --libs gssapi  # does work
-L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,-z,relro -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err

      


Issue 2 - libgssapi_krb5.so: Unable to open shared objects file: No such file or directory



setup.py

is in /usr/lib

for the gssapi library for reference. In Debian Jesse, most libs are now stored in /usr/lib/x86_64-linux-gnu

. Again, symlink can fix this:

$ sudo ln -s /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 /usr/lib/libgssapi_krb5.so

      


Problem 3 - error: unknown name like 'gss_key_value_set_desc

The build failed because it does not recognize the symbol in the library. The reason for this is that it was unable to get the correct header file. Silly me, I forgot to include the package -dev

for the krb5 headers. Fix it with apt-get:

$ sudo apt-get install libkrb5-dev

      


Finally - install gssapi

We should now be ready to go.

$ sudo pip install gssapi

      

If you want to tidy up, you can remove the symbolic link with the command krb5-config.mit

:

$ sudo rm /usr/bin/krb5-config

      

+5


source







All Articles