我是Python Django的新手,正在Windows 7上构建Django应用程序。我的要求是将LDAP与Django集成。所以我按照下面的URL安装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:\users\ccduce\appdata\local\continuum\miniconda3\lib\site-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:\users\ccduce\appdata\local\continuum\miniconda3\lib\site-packages (from Django>=1
.11->django-auth-ldap) (2018.4)
Requirement already satisfied: pyasn1>=0.3.7 in c:\users\ccduce\appdata\local\continuum\miniconda3\lib\site-packages (from
python-ldap>=3.1->django-auth-ldap) (0.4.4)
Requirement already satisfied: pyasn1_modules>=0.1.5 in c:\users\ccduce\appdata\local\continuum\miniconda3\lib\site-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:\users\ccduce\appdata\local\continuum\miniconda3\python.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('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C
:\Users\ccduce\AppData\Local\Temp\pip-wheel-6ztc_mq2 --python-tag cp36:
polls\views.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:\users\ccduce\appdata\local\continuum\miniconda3\python.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('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --reco
rd C:\Users\ccduce\AppData\Local\Temp\pip-record-7f0q21s7\install-record.txt --single-version-externally-managed --compile:
running install
running build
polls\views.py17:1
LFUTF-8Python0 files
creating build\lib.win-amd64-3.6
copying Lib\ldapurl.py -> build\lib.win-amd64-3.6
copying Lib\ldif.py -> build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\ldap
copying Lib\ldap\async.py -> build\lib.win-amd64-3.6\ldap
copying Lib\ldap\asyncsearch.py -> build\lib.win-amd64-3.6\ldap
copying Lib\ldap\cidict.py -> build\lib.win-amd64-3.6\ldap
copying Lib\ldap\compat.py -> build\lib.win-amd64-3.6\ldap
copying Lib\ldap\constants.py -> build\lib.win-amd64-3.6\ldap
copying Lib\ldap\dn.py -> build\lib.win-amd64-3.6\ldap
copying Lib\ldap\filter.py -> build\lib.win-amd64-3.6\ldap
copying Lib\ldap\functions.py -> build\lib.win-amd64-3.6\ldap
copying Lib\ldap\ldapobject.py -> build\lib.win-amd64-3.6\ldap
copying Lib\ldap\logger.py -> build\lib.win-amd64-3.6\ldap
copying Lib\ldap\modlist.py -> build\lib.win-amd64-3.6\ldap
copying Lib\ldap\pkginfo.py -> build\lib.win-amd64-3.6\ldap
copying Lib\ldap\resiter.py -> build\lib.win-amd64-3.6\ldap
copying Lib\ldap\sasl.py -> build\lib.win-amd64-3.6\ldap
copying Lib\ldap\syncrepl.py -> build\lib.win-amd64-3.6\ldap
copying Lib\ldap\__init__.py -> build\lib.win-amd64-3.6\ldap
creating build\lib.win-amd64-3.6\ldap\controls
copying Lib\ldap\controls\deref.py -> build\lib.win-amd64-3.6\ldap\controls
copying Lib\ldap\controls\libldap.py -> build\lib.win-amd64-3.6\ldap\controls
copying Lib\ldap\controls\openldap.py -> build\lib.win-amd64-3.6\ldap\controls
copying Lib\ldap\controls\pagedresults.py -> build\lib.win-amd64-3.6\ldap\controls
polls\views.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:\users\ccduce\appdata\local\continuum\miniconda3\python.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('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\ccduce\AppDa
ta\Local\Temp\pip-record-7f0q21s7\install-record.txt --single-version-externally-managed --compile" failed with error code
1 in C:\Users\ccduce\AppData\Local\Temp\pip-install-c5a5rvyv\python-ldap\
如果有人能帮助我摆脱这个问题,我将非常感激,因为我花了几天多时间来解决此问题,而且我也不清楚为什么它要研究Microsoft Visual Studio 14.0(系统找不到指定的路径:
'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\
VC\\PlatformSDK\\lib')
答案 0 :(得分:0)
我前段时间有同样的问题,使用过轮文件。您可以为Python版本django-auth-ldap-installation-not-working
使用适当的wheel文件(其中包含所有依赖项)