首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何安装django-auth-ldap

如何安装django-auth-ldap
EN

Stack Overflow用户
提问于 2022-05-18 17:41:06
回答 1查看 2.1K关注 0票数 1

因此,我试图将django-auth-ldap安装到我的系统中,但它总是会出现错误。

我在Ubuntu 20.04上和Django 4.0.4一起使用Django 4.0.4

代码语言:javascript
复制
(.venv) user@vmlist:~/test/vmlist_frontend$ pip3.10 install django-auth-ldap
代码语言:javascript
复制
Collecting django-auth-ldap
  Using cached django_auth_ldap-4.1.0-py3-none-any.whl (20 kB)
Collecting python-ldap>=3.1
  Using cached python-ldap-3.4.0.tar.gz (376 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: Django>=2.2 in /home/user/test/.venv/lib/python3.10/site-packages (from django-auth-ldap) (4.0.4)
Requirement already satisfied: sqlparse>=0.2.2 in /home/user/test/.venv/lib/python3.10/site-packages (from Django>=2.2->django-auth-ldap) (0.4.2)
Requirement already satisfied: asgiref<4,>=3.4.1 in /home/user/test/.venv/lib/python3.10/site-packages (from Django>=2.2->django-auth-ldap) (3.5.2)
Collecting pyasn1-modules>=0.1.5
  Using cached pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
Requirement already satisfied: pyasn1>=0.3.7 in /home/user/test/.venv/lib/python3.10/site-packages (from python-ldap>=3.1->django-auth-ldap) (0.4.8)
Building wheels for collected packages: python-ldap
  Building wheel for python-ldap (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for python-ldap (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [101 lines of output]
      /tmp/pip-build-env-kzs5bz2f/overlay/lib/python3.10/site-packages/setuptools/config/setupcfg.py:459: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      copying Lib/ldapurl.py -> build/lib.linux-x86_64-cpython-310
      copying Lib/ldif.py -> build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/ldap
      copying Lib/ldap/cidict.py -> build/lib.linux-x86_64-cpython-310/ldap
      copying Lib/ldap/functions.py -> build/lib.linux-x86_64-cpython-310/ldap
      copying Lib/ldap/logger.py -> build/lib.linux-x86_64-cpython-310/ldap
      copying Lib/ldap/async.py -> build/lib.linux-x86_64-cpython-310/ldap
      copying Lib/ldap/resiter.py -> build/lib.linux-x86_64-cpython-310/ldap
      copying Lib/ldap/modlist.py -> build/lib.linux-x86_64-cpython-310/ldap
      copying Lib/ldap/ldapobject.py -> build/lib.linux-x86_64-cpython-310/ldap
      copying Lib/ldap/pkginfo.py -> build/lib.linux-x86_64-cpython-310/ldap
      copying Lib/ldap/syncrepl.py -> build/lib.linux-x86_64-cpython-310/ldap
      copying Lib/ldap/constants.py -> build/lib.linux-x86_64-cpython-310/ldap
      copying Lib/ldap/asyncsearch.py -> build/lib.linux-x86_64-cpython-310/ldap
      copying Lib/ldap/filter.py -> build/lib.linux-x86_64-cpython-310/ldap
      copying Lib/ldap/dn.py -> build/lib.linux-x86_64-cpython-310/ldap
      copying Lib/ldap/sasl.py -> build/lib.linux-x86_64-cpython-310/ldap
      copying Lib/ldap/__init__.py -> build/lib.linux-x86_64-cpython-310/ldap
      copying Lib/ldap/compat.py -> build/lib.linux-x86_64-cpython-310/ldap
      creating build/lib.linux-x86_64-cpython-310/ldap/controls
      copying Lib/ldap/controls/libldap.py -> build/lib.linux-x86_64-cpython-310/ldap/controls
      copying Lib/ldap/controls/sessiontrack.py -> build/lib.linux-x86_64-cpython-310/ldap/controls
      copying Lib/ldap/controls/openldap.py -> build/lib.linux-x86_64-cpython-310/ldap/controls
      copying Lib/ldap/controls/psearch.py -> build/lib.linux-x86_64-cpython-310/ldap/controls
      copying Lib/ldap/controls/pwdpolicy.py -> build/lib.linux-x86_64-cpython-310/ldap/controls
      copying Lib/ldap/controls/ppolicy.py -> build/lib.linux-x86_64-cpython-310/ldap/controls
      copying Lib/ldap/controls/readentry.py -> build/lib.linux-x86_64-cpython-310/ldap/controls
      copying Lib/ldap/controls/pagedresults.py -> build/lib.linux-x86_64-cpython-310/ldap/controls
      copying Lib/ldap/controls/simple.py -> build/lib.linux-x86_64-cpython-310/ldap/controls
      copying Lib/ldap/controls/sss.py -> build/lib.linux-x86_64-cpython-310/ldap/controls
      copying Lib/ldap/controls/vlv.py -> build/lib.linux-x86_64-cpython-310/ldap/controls
      copying Lib/ldap/controls/__init__.py -> build/lib.linux-x86_64-cpython-310/ldap/controls
      copying Lib/ldap/controls/deref.py -> build/lib.linux-x86_64-cpython-310/ldap/controls
      creating build/lib.linux-x86_64-cpython-310/ldap/extop
      copying Lib/ldap/extop/passwd.py -> build/lib.linux-x86_64-cpython-310/ldap/extop
      copying Lib/ldap/extop/dds.py -> build/lib.linux-x86_64-cpython-310/ldap/extop
      copying Lib/ldap/extop/__init__.py -> build/lib.linux-x86_64-cpython-310/ldap/extop
      creating build/lib.linux-x86_64-cpython-310/ldap/schema
      copying Lib/ldap/schema/models.py -> build/lib.linux-x86_64-cpython-310/ldap/schema
      copying Lib/ldap/schema/tokenizer.py -> build/lib.linux-x86_64-cpython-310/ldap/schema
      copying Lib/ldap/schema/subentry.py -> build/lib.linux-x86_64-cpython-310/ldap/schema
      copying Lib/ldap/schema/__init__.py -> build/lib.linux-x86_64-cpython-310/ldap/schema
      creating build/lib.linux-x86_64-cpython-310/slapdtest
      copying Lib/slapdtest/_slapdtest.py -> build/lib.linux-x86_64-cpython-310/slapdtest
      copying Lib/slapdtest/__init__.py -> build/lib.linux-x86_64-cpython-310/slapdtest
      running egg_info
      writing Lib/python_ldap.egg-info/PKG-INFO
      writing dependency_links to Lib/python_ldap.egg-info/dependency_links.txt
      writing requirements to Lib/python_ldap.egg-info/requires.txt
      writing top-level names to Lib/python_ldap.egg-info/top_level.txt
      reading manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      no previously-included directories found matching 'Doc/.build'
      adding license file 'LICENCE'
      writing manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
      /tmp/pip-build-env-kzs5bz2f/overlay/lib/python3.10/site-packages/setuptools/command/build_py.py:153: SetuptoolsDeprecationWarning:     !!


          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'slapdtest.certs' as an importable package, however it is
          included in the distribution as "data".
          This behavior is likely to change in future versions of setuptools (and
          therefore is considered deprecated).

          Please make sure that 'slapdtest.certs' is included as a package by using
          setuptools' `packages` configuration field or the proper discovery methods.

          You can read more about "package discovery" and "data files" on setuptools
          documentation page.


      !!

        check.warn(importable)
      creating build/lib.linux-x86_64-cpython-310/slapdtest/certs
      copying Lib/slapdtest/certs/README -> build/lib.linux-x86_64-cpython-310/slapdtest/certs
      copying Lib/slapdtest/certs/ca.conf -> build/lib.linux-x86_64-cpython-310/slapdtest/certs
      copying Lib/slapdtest/certs/ca.pem -> build/lib.linux-x86_64-cpython-310/slapdtest/certs
      copying Lib/slapdtest/certs/client.conf -> build/lib.linux-x86_64-cpython-310/slapdtest/certs
      copying Lib/slapdtest/certs/client.key -> build/lib.linux-x86_64-cpython-310/slapdtest/certs
      copying Lib/slapdtest/certs/client.pem -> build/lib.linux-x86_64-cpython-310/slapdtest/certs
      copying Lib/slapdtest/certs/gencerts.sh -> build/lib.linux-x86_64-cpython-310/slapdtest/certs
      copying Lib/slapdtest/certs/gennssdb.sh -> build/lib.linux-x86_64-cpython-310/slapdtest/certs
      copying Lib/slapdtest/certs/server.conf -> build/lib.linux-x86_64-cpython-310/slapdtest/certs
      copying Lib/slapdtest/certs/server.key -> build/lib.linux-x86_64-cpython-310/slapdtest/certs
      copying Lib/slapdtest/certs/server.pem -> build/lib.linux-x86_64-cpython-310/slapdtest/certs
      running build_ext
      building '_ldap' extension
      creating build/temp.linux-x86_64-cpython-310
      creating build/temp.linux-x86_64-cpython-310/Modules
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=3.4.0 "-DLDAPMODULE_AUTHOR=python-ldap project" "-DLDAPMODULE_LICENSE=Python style" -IModules -I/home/user/test/.venv/include -I/usr/include/python3.10 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-cpython-310/Modules/LDAPObject.o
      error: command 'x86_64-linux-gnu-gcc' failed: No such file or directory
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for python-ldap
Failed to build python-ldap
ERROR: Could not build wheels for python-ldap, which is required to install pyproject.toml-based projects

我试图安装ldap的先决条件(它们确实成功地安装了),但也没有帮助。

代码语言:javascript
复制
sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev

如何解决门廊问题?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-05-20 09:31:54

通过安装这些东西来修复门廊:

代码语言:javascript
复制
sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev

sudo apt-get install build-essential python3-dev python3.10-dev python2.7-dev libldap2-dev libsasl2-dev slapd ldap-utils tox lcov valgrind
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72293722

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档