本文介绍了如何修复python django_auth_ldap上的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题!

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

When I try to install django_auth_ldap on Windows x64, python 2.7 64. I get this error:

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

推荐答案

来自 django_auth_ldap 的文档:

From the documentation of django_auth_ldap:

似乎您错过了安装 OpenLDAP库和标头的部分,错误显示在这里:

It seems you had missed the part for installing the OpenLDAP libraries and headers, as your error show here:

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

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

Instructions to install OpenLDAP can be found here: https://www.openldap.org/software/release/install.html

这篇关于如何修复python django_auth_ldap上的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-08 09:39