简体   繁体   English

没有名为“ flask_ldap3_login”的模块

[英]No module named 'flask_ldap3_login'

I am setting up flask login page with ldap3. 我正在使用ldap3设置flask登录页面。 I am using python 3.6.8 and using ldap3. 我正在使用python 3.6.8和ldap3。 After pip3 install flask-ldap3-login I am getting ModuleNotFoundError: No module named 'flask_ldap3_login' pip3 install flask-ldap3-login我得到ModuleNotFoundError: No module named 'flask_ldap3_login'

I found https://pypi.org/project/flask-ldap3-login/ Flask LDAP3 Login uses the ldap3 library, maintaining compatability with python 3.4 and backwards. 我发现https://pypi.org/project/flask-ldap3-login/ Flask LDAP3登录使用ldap3库,与python 3.4以及向后兼容。 But Python 3.4 has reached end-of-life. 但是Python 3.4已经到了使用寿命。 Python 3.4.10 is the final release of 3.4. Python 3.4.10是3.4的最终版本。 I also tried pip3 install python-ldap but cant get ldap autentificate successfull. 我还尝试了pip3 install python-ldap但无法成功获得ldap。

(venv) $ sudo python3 run.py
Traceback (most recent call last):
  File "run.py", line 1, in <module>
    from app import app
  File "app/__init__.py", line 5, in <module>
    from flask_ldap3_login import LDAP3LoginManager
ModuleNotFoundError: No module named 'flask_ldap3_login'
(venv)$ pip3 install flask-ldap3-login
Requirement already satisfied: flask-ldap3-login in ./venv/lib/python3.6/site-packages (0.9.16)
Requirement already satisfied: ldap3>=2.0.7 in ./venv/lib/python3.6/site-packages (from flask-ldap3-login) (2.6)
Requirement already satisfied: Flask in ./venv/lib/python3.6/site-packages (from flask-ldap3-login) (1.1.1)
Requirement already satisfied: Flask-wtf in ./venv/lib/python3.6/site-packages (from flask-ldap3-login) (0.14.2)
Requirement already satisfied: pyasn1>=0.1.8 in ./venv/lib/python3.6/site-packages (from ldap3>=2.0.7->flask-ldap3-login) (0.4.6)
Requirement already satisfied: Werkzeug>=0.15 in ./venv/lib/python3.6/site-packages (from Flask->flask-ldap3-login) (0.15.5)
Requirement already satisfied: Jinja2>=2.10.1 in ./venv/lib/python3.6/site-packages (from Flask->flask-ldap3-login) (2.10.1)
Requirement already satisfied: itsdangerous>=0.24 in ./venv/lib/python3.6/site-packages (from Flask->flask-ldap3-login) (1.1.0)
Requirement already satisfied: click>=5.1 in ./venv/lib/python3.6/site-packages (from Flask->flask-ldap3-login) (7.0)
Requirement already satisfied: WTForms in ./venv/lib/python3.6/site-packages (from Flask-wtf->flask-ldap3-login) (2.2.1)
Requirement already satisfied: MarkupSafe>=0.23 in ./venv/lib/python3.6/site-packages (from Jinja2>=2.10.1->Flask->flask-ldap3-login) (1.1.1)
(venv)$ python
Python 3.6.8 (default, Jun 12 2019, 01:12:31)
[GCC 8.2.1 20180905 (Red Hat 8.2.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

Expected result is app run.py run successfully. 预期结果是应用程序run.py成功运行。 Anybody runs flask_ldap3_login on newer version of python? 有人在较新版本的python上运行flask_ldap3_login吗? Or how ca i fix this, or no fix for python 3.6.8. 或我如何解决这个问题,或者没有针对python 3.6.8的修复。

Thank you. 谢谢。

Running script without sudo privileges and everything works. 没有sudo特权的运行脚本,一切正常。 Thank you. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM