简体   繁体   English

“缺少必需的“ ldap”模块(pip install python-ldap)

[英]"Missing required 'ldap' module (pip install python-ldap)

I am running osx-mojave and I am trying to run ansible with the ldap-module. 我正在运行osx-mojave,并且正在尝试使用ldap-module运行ansible。

However, when I try to run it like this 但是,当我尝试像这样运行时

ansible-playbook play.yml

I get this error 我得到这个错误

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

I have searched similar questions on this site and I cant find a solution to this. 我已经在该网站上搜索了类似的问题,但找不到解决方案。

I have run 我跑了

pip install python-ldap

and

sudo pip install python-ldap

This is the output 这是输出

Requirement already satisfied: python-ldap in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (3.2.0) Requirement already satisfied: pyasn1>=0.3.7 in /Users/testuser/Library/Python/3.7/lib/python/site-packages (from python-ldap) (0.4.5) Requirement already satisfied: pyasn1-modules>=0.1.5 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from python-ldap) (0.2.5)

It doesn't solve the problem. 它不能解决问题。

The output of pip freeze : 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

If anyone has a solution for this please let me know. 如果有人对此有解决方案,请告诉我。

your computer might not recognize the command python or pip, 您的计算机可能无法识别python或pip命令,

try looking up how to get your osx computer to recognize the pip or python command from the terminal. 尝试查找如何使osx计算机从终端识别pip或python命令。

sorry i'm not an osx guy sorry. 对不起,我不是OSX家伙。

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

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