0

I am executing my script on Mac (macOS 10.14.1) using Python (2.7.10). This is what i have in my script:

server_jenkins = jenkins.Jenkins(JENKINS_URL, username=JENKINS_USER, password=JENKINS_PASS)

And this is the error i am getting:

AttributeError: 'module' object has no attribute 'Jenkins'
Nisim Naim
  • 151
  • 1
  • 15

2 Answers2

1

That's because you using the wrong package, to solve this problem, please use the flowing commands

sudo pip uninstall jenkins 
sudo pip install python-jenkins
0

The error means that jenkins module has no class (read attribute) named Jenkins. Since this is not true for the actual jenkins module, it is likely that you have a file called jenkins.py which is being read and processed by the code.

unixia
  • 4,102
  • 1
  • 19
  • 23
  • Where am i supposed to have a file named "jenkins.py"? there is not such file in the same folder where i have my python script. – Nisim Naim Jan 22 '19 at 11:25
  • I am trying to execute the same script from 2 different mac machines. From one it works fine, from the second i am getting the error message i attached. – Nisim Naim Jan 22 '19 at 11:32
  • You should look for jenkins.py in the machine where this is failing. Do a `find . -name "jenkins.py"` in the root of your project. – unixia Jan 22 '19 at 15:23