0

i am trying to run my python script that works fine locally, on our corporate Jenkins.

On top of the script i have

from appium import webdriver

and getting this error in Jenkins:

File "/home/emobappta/jenkins-workspace/workspace/xz1nwi_Jenkinsfile-1647515865042/Skripte/test2.py", line 5, in <module>
    from appium import webdriver
ModuleNotFoundError: No module named 'appium'

I have the whole appium folder in the same directory on my bitbucket and at this point no idea what i can try...

By including

pprint.pprint(sys.path) "

in my Jenkinsfile i get the following output:

'/home/emobappta/jenkins-workspace/workspace/xz1nwi_Jenkinsfile-1647515865042/Skripte',

'/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages']

DTo
  • 1
  • 1

1 Answers1

1

I'm not sure what you are referring to by 'appium folder', so I might be entirely confused about what you are asking since you generally don't go around copying libraries when moving projects. However, what I simply see is that the package itself is missing. So try running

pip install Appium-Python-Client

using a terminal in your corporate server. Check if you are using a venv, which means that its packages are isolated. If that is the case, open a terminal, switch to that venv, and execute the above command.

M B
  • 2,700
  • 2
  • 15
  • 20
  • the install worked..it seems to be importing, but now i get an errno 111 connection resufed in the driversetup part, trying to connect to the localhost. perhaps any idea how to build a connection to the appium server thats running on my desktop? – DTo Apr 11 '22 at 08:49
  • Check if your server port is open. Refer to this answer for more: https://stackoverflow.com/a/27234405/3730626 – M B Apr 12 '22 at 01:57