获取python jenkins错误,尽管我有最新的pip和python版本,并且已经安装了python jenkins

获取python jenkins错误,尽管我有最新的pip和python版本,并且已经安装了python jenkins,python,jenkins,Python,Jenkins,我的剧本里有一个任务,就是要了解詹金斯的工作情况 - jenkins_job_facts: color: green user: "{{jenkinsuid}}" password: "{{jenkinspwd}}" register: jenkins_status 对于上述任务,我得到以下错误: "fatal: [localhost]: FAILED! => {"changed": false, "msg": "python-jenkins required

我的剧本里有一个任务,就是要了解詹金斯的工作情况

- jenkins_job_facts:
    color: green
    user: "{{jenkinsuid}}"
    password: "{{jenkinspwd}}"
  register: jenkins_status
对于上述任务,我得到以下错误:

"fatal: [localhost]: FAILED! => {"changed": false, "msg": "python-jenkins required for this module.
see http://python-jenkins.readthedocs.io/en/latest/install.html"}"
我的mac电脑中安装了这些:

Ansible 2.7.0dev0
pip 10.0.1 from /Library/Python/2.7/site-packages/pip (python 2.7)
Python 2.7.10
Python 3.6.5
jankinsapi 0.3.6
并在安装python jenkins后收到以下消息:

"Successfully installed certifi-2018.4.16 chardet-3.0.4 multi-key-dict-2.0.3 pbr-4.0.3 python-jenkins-1.0.0 requests-2.18.4 urllib3-1.22"
我做了广泛的在线搜索,并尝试了各种选择。。。我还不能解决这个问题。我是不是遗漏了什么


如果我同时拥有python 2.7.10和3.6.5两个版本(如果是,请让我知道完全删除这两个python版本并安装最新版本3.6.5的步骤),这会是一个问题吗?

Ansible默认使用
/usr/bin/python
。哪个版本适合你?如果不是2.7,请尝试将
ansible\u python\u解释器设置为默认的python3路径,即/Library/Frameworks/python.framework/Versions/3.6/bin/python3。您在python 3中尝试过
import jenkins
?如果不起作用,请尝试使用
/usr/bin/python
。可能是
pip
安装了
pythonjenkins
在python3未知的地方。/usr/bin/python无法工作。在我编写Ansible代码时,我们是否为Python3配置了“Import jenkins”(我没有使用任何Python代码)?