如何修复pythonDjango_auth_ldap上的错误

2024-09-27 00:16:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我有问题!在

当我尝试在Windowsx64,Python2.7 64上安装django_auth_ldap时。我得到这个错误:

控制台日志
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\

Tags: installpipincludeusrlocalldapexeusers
1条回答
网友
1楼 · 发布于 2024-09-27 00:16:44

documentation of ^{}

Under Python 2, it requires python-ldap >= 2.0; under Python 3, it uses pyldap. In either case, you’ll need the OpenLDAP libraries and headers available on your system.

您似乎错过了安装OpenLDAP库和头文件的部分,如下所示:

Cannot open include file: 'lber.h': No such file or directory

安装OpenLDAP的说明可以在这里找到:https://www.openldap.org/software/release/install.html

相关问题 更多 >

    热门问题