gpt4 book ai didi

python - "Missing required ' ldap'模块(pip install python-ldap)

转载 作者:太空宇宙 更新时间:2023-11-03 20:39:15 24 4
gpt4 key购买 nike

我正在运行 osx-mojave,并尝试使用 ldap 模块运行 ansible。

但是,当我尝试像这样运行它时

ansible-playbook play.yml

我收到此错误

PLAY [localhost] ************************************************************************************************************************************
TASK [Gathering Facts] ***************************************************************************
ok: [localhost]

TASK [create the account] ***************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Missing required 'ldap' module (pip install python-ldap)."}
to retry, use: --limit @/Users/testuser/adtest/play.retry

PLAY RECAP ***************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1

我在这个网站上搜索过类似的问题,但找不到解决方案。

我跑了

pip install python-ldap

sudo pip install python-ldap

这是输出

已满足要求:/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (3.2.0) 中的 python-ldap
已满足要求:/Users/testuser/Library/Python/3.7/lib/python/site-packages 中的 pyasn1>=0.3.7 (来自 python-ldap)(0.4.5)
已满足要求:/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages 中的 pyasn1-modules>=0.1.5 (来自 python-ldap) (0.2.5)

这并不能解决问题。

pip freeze 的输出:

$ pip freeze 
awscli==1.16.132
botocore==1.12.122
colorama==0.3.9
docutils==0.14
jmespath==0.9.4
ldap3==2.6
pbr==5.2.1
pyasn1==0.4.5
pyasn1-modules==0.2.5
python-dateutil==2.8.0
python-ldap==3.2.0
python3-ldap==0.9.8.4
PyYAML==3.13 rsa==3.4.2
s3transfer==0.2.0
six==1.12.0
stevedore==1.30.1
urllib3==1.24.1
virtualenv==16.6.0
virtualenv-clone==0.5.3
virtualenvwrapper==4.8.4

如果有人有解决方案,请告诉我。

最佳答案

您的计算机可能无法识别命令 python 或 pip,

尝试查找如何让您的 osx 计算机识别 pip 或 python 命令从终端。

抱歉,我不是 osx 人,抱歉。

关于python - "Missing required ' ldap'模块(pip install python-ldap),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56959351/

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