7

I keep getting GCC compilation errors:

$ pip install python-ldap
...
compilation terminated.

error: command 'gcc' failed with exit status 1
Jace Browning
  • 11,699
  • 10
  • 66
  • 90
  • 2
    possible duplicate of [Python: can't install python-ldap](http://stackoverflow.com/questions/4768446/python-cant-install-python-ldap) – Chillar Anand Sep 28 '15 at 04:48

1 Answers1

19

I found this blog post which has the answer:

http://blog.mattwoodward.com/2012/10/installing-python-ldap-in-virtualenv-on.html

Essentially, you need to ensure you have the necessary development libraries installed:

sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
Jace Browning
  • 11,699
  • 10
  • 66
  • 90
  • 2
    Good find. If you plan to compile from source more often, the 'build-essential' meta package is good to have aboard as well. – TeTeT Aug 08 '13 at 20:01
  • I didn't know about this! Link for the lazy: http://packages.ubuntu.com/lucid/build-essential – Jace Browning Aug 08 '13 at 20:07
  • Appreciated, your answer helped me too. :) – CrazyGeek Mar 07 '14 at 12:14
  • This does not work on Ubuntu 16.x. I do not know why. But it gives the same complaint even after the apt-get line above. –  Mar 06 '17 at 02:03