Django的Ldap安装构建失败



我是Python Django的新手,我正在Windows7上构建我的Django应用程序。我的要求是将LDAP与Django集成。所以我按照下面的URL安装LDAP

安装-Django LDAP

当我尝试安装LDAP然后安装时

pip install django-auth-ldap

然后我得到

Collecting django-auth-ldap
Using cached https://files.pythonhosted.org/packages/c1/c4/e1586a835b5bf76d4d914f1622020ae9ab9d9be7149e216e19c8428670d1/d
jango_auth_ldap-1.7.0-py2.py3-none-any.whl
Requirement already satisfied: Django>=1.11 in c:usersccduceappdatalocalcontinuumminiconda3libsite-packages (from d
jango-auth-ldap) (2.0.6)
Collecting python-ldap>=3.1 (from django-auth-ldap)
Using cached https://files.pythonhosted.org/packages/7f/1c/28d721dff2fcd2fef9d55b40df63a00be26ec8a11e8c6fc612ae642f9cfd/p
ython-ldap-3.1.0.tar.gz
Requirement already satisfied: pytz in c:usersccduceappdatalocalcontinuumminiconda3libsite-packages (from Django>=1
.11->django-auth-ldap) (2018.4)
Requirement already satisfied: pyasn1>=0.3.7 in c:usersccduceappdatalocalcontinuumminiconda3libsite-packages (from
python-ldap>=3.1->django-auth-ldap) (0.4.4)
Requirement already satisfied: pyasn1_modules>=0.1.5 in c:usersccduceappdatalocalcontinuumminiconda3libsite-package
s (from python-ldap>=3.1->django-auth-ldap) (0.2.2)
Building wheels for collected packages: python-ldap
Running setup.py bdist_wheel for python-ldap ... error
Complete output from command c:usersccduceappdatalocalcontinuumminiconda3python.exe -u -c "import setuptools, toke
nize;__file__='C:\Users\ccduce\AppData\Local\Temp\pip-install-c5a5rvyv\python-ldap\setup.py';f=getattr(tokenize, 'o
pen', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C
:UsersccduceAppDataLocalTemppip-wheel-6ztc_mq2 --python-tag cp36:
pollsviews.py17:1
LFUTF-8Python0 files
running build_ext
building '_ldap' extension
error: [WinError 3] The system cannot find the path specified: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
\PlatformSDK\lib'

----------------------------------------
Failed building wheel for python-ldap
Running setup.py clean for python-ldap
Failed to build python-ldap
Installing collected packages: python-ldap, django-auth-ldap
Running setup.py install for python-ldap ... error
Complete output from command c:usersccduceappdatalocalcontinuumminiconda3python.exe -u -c "import setuptools, to
kenize;__file__='C:\Users\ccduce\AppData\Local\Temp\pip-install-c5a5rvyv\python-ldap\setup.py';f=getattr(tokenize,
'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --reco
rd C:UsersccduceAppDataLocalTemppip-record-7f0q21s7install-record.txt --single-version-externally-managed --compile:
running install
running build
pollsviews.py17:1
LFUTF-8Python0 files
creating buildlib.win-amd64-3.6
copying Libldapurl.py -> buildlib.win-amd64-3.6
copying Libldif.py -> buildlib.win-amd64-3.6
creating buildlib.win-amd64-3.6ldap
copying Libldapasync.py -> buildlib.win-amd64-3.6ldap
copying Libldapasyncsearch.py -> buildlib.win-amd64-3.6ldap
copying Libldapcidict.py -> buildlib.win-amd64-3.6ldap
copying Libldapcompat.py -> buildlib.win-amd64-3.6ldap
copying Libldapconstants.py -> buildlib.win-amd64-3.6ldap
copying Libldapdn.py -> buildlib.win-amd64-3.6ldap
copying Libldapfilter.py -> buildlib.win-amd64-3.6ldap
copying Libldapfunctions.py -> buildlib.win-amd64-3.6ldap
copying Libldapldapobject.py -> buildlib.win-amd64-3.6ldap
copying Libldaplogger.py -> buildlib.win-amd64-3.6ldap
copying Libldapmodlist.py -> buildlib.win-amd64-3.6ldap
copying Libldappkginfo.py -> buildlib.win-amd64-3.6ldap
copying Libldapresiter.py -> buildlib.win-amd64-3.6ldap
copying Libldapsasl.py -> buildlib.win-amd64-3.6ldap
copying Libldapsyncrepl.py -> buildlib.win-amd64-3.6ldap
copying Libldap__init__.py -> buildlib.win-amd64-3.6ldap
creating buildlib.win-amd64-3.6ldapcontrols
copying Libldapcontrolsderef.py -> buildlib.win-amd64-3.6ldapcontrols
copying Libldapcontrolslibldap.py -> buildlib.win-amd64-3.6ldapcontrols
copying Libldapcontrolsopenldap.py -> buildlib.win-amd64-3.6ldapcontrols
copying Libldapcontrolspagedresults.py -> buildlib.win-amd64-3.6ldapcontrols
pollsviews.py17:1
LFUTF-8Python0 files
running build_ext
building '_ldap' extension
error: [WinError 3] The system cannot find the path specified: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\
VC\PlatformSDK\lib'
----------------------------------------
Command "c:usersccduceappdatalocalcontinuumminiconda3python.exe -u -c "import setuptools, tokenize;__file__='C:\Use
rs\ccduce\AppData\Local\Temp\pip-install-c5a5rvyv\python-ldap\setup.py';f=getattr(tokenize, 'open', open)(__file__);
code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersccduceAppDa
taLocalTemppip-record-7f0q21s7install-record.txt --single-version-externally-managed --compile" failed with error code
1 in C:UsersccduceAppDataLocalTemppip-install-c5a5rvyvpython-ldap

如果有人帮我摆脱这个问题,我将不胜感激,因为我已经花了几天的时间来解决这个问题,而且我也不清楚它为什么要调查Microsoft Visual Studio 14.0(系统找不到指定的路径:

'C:\Program Files (x86)\Microsoft Visual Studio 14.0\
VC\PlatformSDK\lib')

我不久前也遇到了同样的问题,使用了wheel文件。您可以为Python版本django-auth-ldap安装使用一个正确的轮子文件(其中包含所有依赖项(,但不起作用