django windows/linux ldap安装配置

Windows上安装openldap:

https://userbooster.de/download/openldap-for-windows.aspx 

Windows上安装python ldap模块:

  • pip3 install python-ldap 报错;下载 python_ldap‑3.1.0‑cp36‑cp36m‑win32.whl,到本地目录,pip3 install python_ldap-3.1.0-cp36-cp36m-win32.whl安装即可,其次安装pip3 install django_auth_ldap,即可在django project中使用。

https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyldap

  • pip3 install ldap3 安装成功。

Linux上安装python-ldap模块:

pip3 install python-ldap 报错:

Running greenlet-0.3.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_aeHYm/greenlet-0.3.4/egg-dist-tmp-t9_gbW
In file included from greenlet.c:5:0:
greenlet.h:8:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1`

需要先安装对应python版本的python-devel,执行如下命令即可:

  • yum install python34-devel.x86_64
  • pip3 install python-ldap

猜你喜欢

转载自blog.csdn.net/neu_xiaolu/article/details/87165704