如何在 Ubuntu 的 virtualenv 中安装 python-ldap?

2022-01-17 00:00:00 python virtualenv ubuntu ldap

问题描述

我不断收到 GCC 编译错误:

I keep getting GCC compilation errors:

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

error: command 'gcc' failed with exit status 1


解决方案

我发现这篇博文有答案:

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

相关文章