First perform:
sudo apt-get install libldap2-dev
sudo apt-get install libsasl2-dev
Then execute, OK:
pip install python-ldap
参考博文内容:
These are the steps to be followed to install python-ldap in Ubuntu. At first,
sudo apt-get install python-ldap
would throw the following error
In file included from Modules/LDAPObject.c:4:0: Modules/common.h:10:20: fatal error: Python.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1
To get past this error, we need to install python-dev package
sudo apt-get install python-dev
After installing that we ll get the following error
In file included from Modules/LDAPObject.c:9:0: Modules/errors.h:8:18: fatal error: lber.h: No such file or directory compilation terminated.
To get past this error, we need to install ldap2-dev package
sudo apt-get install libldap2-dev
After installing that we ll get the following error
Modules/LDAPObject.c:18:18: fatal error: sasl.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1
To get past this error, we need to install libsasl2-dev package
sudo apt-get install libsasl2-dev
After that
sudo apt-get install python-ldap
should install python-ldap without any problems.
Similar Posts:
- Linux Error: _mysql.c:32:20: fatal error: Python.h: No such file or directory [Solved]
- fatal error: Python.h: No such file or directory solution methods
- How to Solve Error in installing MySQL Python in Pip
- Python compiles and installs under Linux and reports an error: makefile: 1141: install
- How to Solve Centos Yum Error: No module named yum
- [How to Solve] ImportError: No module named MySQLdb
- [Solved] ImportError: No module named ‘_tkinter’, please install the python3-tk package
- [Solved] Centos6: Python 2.6 upgrade to 3.7, error handling [no module named ‘_ctypes’]
- How to Solve pip3 ImportError: cannot import name ‘main’
- caffe2——–ImportError: No module named past.builtins