如何修复python django_auth_ldap上的错误

时间:2017-11-29 07:04:05

标签: python django python-2.7

我有问题!

当我尝试在Windows x64上安装django_auth_ldap时,python 2.7 64.我收到此错误:

控制台日志
pip install django_auth_ldap之后

    C:\Users\Dmisss\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_SASL -DLDAPMODULE_VERSION=2.5.2 "-DLDAPMODULE_AUTHOR=python-ldap project" "-DLDAPMODULE_LICENSE=Python style" -IModules -I/usr/include -I/usr/include/sasl -I/usr/local/include -I/usr/local/include/sasl -Ic:\python27\include -Ic:\python27\PC /TcModules/LDAPObject.c /Fobuild\temp.win-amd64-2.7\Release\Modules/LDAPObject.obj
    LDAPObject.c
    c:\users\dmisss\appdata\local\temp\pip-build-tcxk8h\python-ldap\modules\errors.h(7) : fatal error C1083: Cannot open include file: 'lber.h': No such file or directory
    error: command 'C:\\Users\\Dmisss\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

    ----------------------------------------
   Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\dmisss\\appdata\\local\\temp\\pip-build-tcxk8h\\python-ldap\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\dmisss\appdata\local\temp\pip-swbv4g-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\dmisss\appdata\local\temp\pip-build-tcxk8h\python-ldap\

1 个答案:

答案 0 :(得分:0)

来自documentation of django_auth_ldap

  

在Python 2下,它需要python-ldap> = 2.0;在Python 3下,它使用pyldap。 在任何一种情况下,您都需要系统上提供的OpenLDAP库和标题。

您似乎错过了安装 OpenLDAP库和标题的部分,因为您的错误显示在此处:

im2, contours, hierarchy = cv2.findContours(thresh,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)

可在此处找到安装Cannot open include file: 'lber.h': No such file or directory 的说明:https://www.openldap.org/software/release/install.html