gpt4 book ai didi

python - 安装python-ldap软件包时出错

转载 作者:行者123 更新时间:2023-11-30 22:12:42 27 4
gpt4 key购买 nike

我正在尝试使用PyCharm安装python-ldap软件包,但无法解决问题,出现以下错误:

enter image description here

错误信息:

收集python-ldap
  使用缓存的https://files.pythonhosted.org/packages/7f/1c/28d721dff2fcd2fef9d55b40df63a00be26ec8a11e8c6fc612ae642f9cfd/python-ldap-3.1.0.tar.gz
收集pyasn1> = 0.3.7(来自python-ldap)
  使用缓存的https://files.pythonhosted.org/packages/a0/70/2c27740f08e477499ce19eefe05dbcae6f19fdc49e9e82ce4768be0643b9/pyasn1-0.4.3-py2.py3-none-any.whl
收集pyasn1_modules> = 0.1.5(来自python-ldap)
  使用缓存的https://files.pythonhosted.org/packages/e9/51/bcd96bf6231d4b2cc5e023c511bee86637ba375c44a6f9d1b4b7ad1ce4b9/pyasn1_modules-0.2.1-py2.py3-none-any.whl
安装收集的软件包:pyasn1,pyasn1-modules,python-ldap
  运行python-ldap的setup.py install:已启动
    为python-ldap运行setup.py install:状态为“错误”
    从命令C:\ Users \ Joan \ PycharmProjects \ prueba \ venv \ Scripts \ python.exe -u -c“ import setuptools,tokenize; file ='C:\ Users \ Joan \ AppData \ Local \ Temp \ pycharm- Packaging \ python-ldap \ setup.py'; f = getattr(tokenize,'open',open)(file); code = f.read()。replace('\ r \ n','\ n'); f.close(); exec(compile(code,file,'exec')))“安装--record C:\ Users \ Joan \ AppData \ Local \ Temp \ pip-record-y2ot_u84 \ install-record.txt-单版本外部管理的--compile --install-headers C:\ Users \ Joan \ PycharmProjects \ prueba \ venv \ include \ site \ python3.6 \ python-ldap:
    运行安装
    运行构建
    运行build_py
    创建build \ lib.win-amd64-3.6
    复制Lib \ ldapurl.py-> build \ lib.win-amd64-3.6
    复制Lib \ ldif.py-> build \ lib.win-amd64-3.6
    创建build \ lib.win-amd64-3.6 \ ldap
    复制Lib \ ldap \ async.py-> build \ lib.win-amd64-3.6 \ ldap
    复制Lib \ ldap \ asyncsearch.py​​-> build \ lib.win-amd64-3.6 \ ldap
    复制Lib \ ldap \ cidict.py-> build \ lib.win-amd64-3.6 \ ldap
    复制Lib \ ldap \ compat.py-> build \ lib.win-amd64-3.6 \ ldap
    复制Lib \ ldap \ constants.py-> build \ lib.win-amd64-3.6 \ ldap
    复制Lib \ ldap \ dn.py-> build \ lib.win-amd64-3.6 \ ldap
    复制Lib \ ldap \ filter.py-> build \ lib.win-amd64-3.6 \ ldap
    复制Lib \ ldap \ functions.py-> build \ lib.win-amd64-3.6 \ ldap
    复制Lib \ ldap \ ldapobject.py-> build \ lib.win-amd64-3.6 \ ldap
    复制Lib \ ldap \ logger.py-> build \ lib.win-amd64-3.6 \ ldap
    复制Lib \ ldap \ modlist.py-> build \ lib.win-amd64-3.6 \ ldap
    复制Lib \ ldap \ pkginfo.py-> build \ lib.win-amd64-3.6 \ ldap
    复制Lib \ ldap \ resiter.py-> build \ lib.win-amd64-3.6 \ ldap
    复制Lib \ ldap \ sasl.py-> build \ lib.win-amd64-3.6 \ ldap
    复制Lib \ ldap \ syncrepl.py-> build \ lib.win-amd64-3.6 \ ldap
    复制Lib \ ldap__init __。py-> build \ lib.win-amd64-3.6 \ ldap
    创建build \ lib.win-amd64-3.6 \ ldap \ controls
    复制Lib \ ldap \ controls \ deref.py-> build \ lib.win-amd64-3.6 \ ldap \ controls
    复制Lib \ ldap \ controls \ libldap.py-> build \ lib.win-amd64-3.6 \ ldap \ controls
    复制Lib \ ldap \ controls \ openldap.py-> build \ lib.win-amd64-3.6 \ ldap \ controls
    复制Lib \ ldap \ controls \ pagedresults.py-> build \ lib.win-amd64-3.6 \ ldap \ controls
    复制Lib \ ldap \ controls \ ppolicy.py-> build \ lib.win-amd64-3.6 \ ldap \ controls
    复制Lib \ ldap \ controls \ psearch.py​​-> build \ lib.win-amd64-3.6 \ ldap \ controls
    复制Lib \ ldap \ controls \ pwdpolicy.py-> build \ lib.win-amd64-3.6 \ ldap \ controls
    复制Lib \ ldap \ controls \ readentry.py-> build \ lib.win-amd64-3.6 \ ldap \ controls
    复制Lib \ ldap \ controls \ sessiontrack.py-> build \ lib.win-amd64-3.6 \ ldap \ controls
    复制Lib \ ldap \ controls \ simple.py-> build \ lib.win-amd64-3.6 \ ldap \ controls
    复制Lib \ ldap \ controls \ sss.py-> build \ lib.win-amd64-3.6 \ ldap \ controls
    复制Lib \ ldap \ controls \ vlv.py-> build \ lib.win-amd64-3.6 \ ldap \ controls
    复制Lib \ ldap \ controls__init __。py-> build \ lib.win-amd64-3.6 \ ldap \ controls
    创建build \ lib.win-amd64-3.6 \ ldap \ extop
    复制Lib \ ldap \ extop \ dds.py-> build \ lib.win-amd64-3.6 \ ldap \ extop
    复制Lib \ ldap \ extop__init __。py-> build \ lib.win-amd64-3.6 \ ldap \ extop
    创建build \ lib.win-amd64-3.6 \ ldap \ schema
    复制Lib \ ldap \ schema \ models.py-> build \ lib.win-amd64-3.6 \ ldap \ schema
    复制Lib \ ldap \ schema \ subentry.py-> build \ lib.win-amd64-3.6 \ ldap \ schema
    复制Lib \ ldap \ schema \ tokenizer.py-> build \ lib.win-amd64-3.6 \ ldap \ schema
    复制Lib \ ldap \ schema__init __。py-> build \ lib.win-amd64-3.6 \ ldap \ schema
    创建build \ lib.win-amd64-3.6 \ slapdtest
    复制Lib \ slapdtest_slapdtest.py-> build \ lib.win-amd64-3.6 \ slapdtest
    复制Lib \ slapdtest__init __。py-> build \ lib.win-amd64-3.6 \ slapdtest
    运行egg_info
    编写Lib \ python_ldap.egg-info \ PKG-INFO
    将dependency_links写入Lib \ python_ldap.egg-info \ dependency_links.txt
    将要求写入Lib \ python_ldap.egg-info \ requires.txt
    将顶级名称写入Lib \ python_ldap.egg-info \ top_level.txt
    读取清单文件“ Lib \ python_ldap.egg-info \ SOURCES.txt”
    阅读清单模板“ MANIFEST.in”
    找不到与“ Doc.build”匹配的先前包含的目录
    编写清单文件“ Lib \ python_ldap.egg-info \ SOURCES.txt”
    创建build \ lib.win-amd64-3.6 \ slapdtest \ certs
    复制Lib \ slapdtest \ certs \ README-> build \ lib.win-amd64-3.6 \ slapdtest \ certs
    复制Lib \ slapdtest \ certs \ ca.conf-> build \ lib.win-amd64-3.6 \ slapdtest \ certs
    复制Lib \ slapdtest \ certs \ ca.pem-> build \ lib.win-amd64-3.6 \ slapdtest \ certs
    复制Lib \ slapdtest \ certs \ client.conf-> build \ lib.win-amd64-3.6 \ slapdtest \ certs
    复制Lib \ slapdtest \ certs \ client.key-> build \ lib.win-amd64-3.6 \ slapdtest \ certs
    复制Lib \ slapdtest \ certs \ client.pem-> build \ lib.win-amd64-3.6 \ slapdtest \ certs
    复制Lib \ slapdtest \ certs \ gencerts.sh-> build \ lib.win-amd64-3.6 \ slapdtest \ certs
    复制Lib \ slapdtest \ certs \ gennssdb.sh-> build \ lib.win-amd64-3.6 \ slapdtest \ certs
    复制Lib \ slapdtest \ certs \ server.conf-> build \ lib.win-amd64-3.6 \ slapdtest \ certs
    复制Lib \ slapdtest \ certs \ server.key-> build \ lib.win-amd64-3.6 \ slapdtest \ certs
    复制Lib \ slapdtest \ certs \ server.pem-> build \ lib.win-amd64-3.6 \ slapdtest \ certs
    警告:build_py:禁用字节编译,正在跳过。

running build_ext
building '_ldap' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\Modules
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=3.1.0 "-DLDAPMODULE_AUTHOR=python-ldap project" "-DLDAPMODULE_LICENSE=Python style" -IModules -IC:\Users\Joan\PycharmProjects\prueba\venv\include -IC:\Users\Joan\AppData\Local\Programs\Python\Python36\include -IC:\Users\Joan\AppData\Local\Programs\Python\Python36\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /TcModules/LDAPObject.c /Fobuild\temp.win-amd64-3.6\Release\Modules/LDAPObject.obj
LDAPObject.c
c:\users\joan\appdata\local\temp\pycharm-packaging\python-ldap\modules\constants.h(7): fatal error C1083: Cannot open include file: 'lber.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

----------------------------------------


命令“ C:\ Users \ Joan \ PycharmProjects \ prueba \ venv \ Scripts \ python.exe -u -c”导入设置工具,标记化;文件='C:\ Users \ Joan \ AppData \ Local \ Temp \ pycharm-packaging \ python-ldap \ setup.py'; f = getattr(tokenize,'open',open)(file); code = f.read()。replace('\ r \ n','\ n'); f。 close(); exec(compile(code,file,'exec')))“安装--record C:\ Users \ Joan \ AppData \ Local \ Temp \ pip-record-y2ot_u84 \ install-record.txt --single-版本外部管理的--compile --install-headers C:\ Users \ Joan \ PycharmProjects \ prueba \ venv \ include \ site \ python3.6 \ python-ldap失败,错误代码1在C:\ Users \ Joan \ AppData \ Local \ Temp \ pycharm-packaging \ python-ldap \

我会很感激的,

先感谢您!

最佳答案

这是因为pip尝试编译OpenLDAP库,而python-ldap只是二进制lib的包装。如果您不想自己编译OpenLDAP库,则建议您访问以下站点:
https://www.lfd.uci.edu/~gohlke/pythonlibs/

根据您使用的python版本下载所需的wheel-file,例如python_ldap-3.2.0-cp37-cp37m-win_amd64.whl适用于Python 3.6 64bit。

然后安装:

python -m pip install python_ldap-3.2.0-cp37-cp37m-win_amd64.whl

关于python - 安装python-ldap软件包时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51030131/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com