1

I am using following piece of code in python:

from appium import webdriver
from os import path


CUR_DIR = path.dirname(path.abspath(__file__))
APP = path.join(CUR_DIR, 'TheApp.app.zip')

APPIUM = 'http://localhost:4723'
CAPS = {
    'platformName': 'iOS',
    'platformVersion': '14.0',
    'deviceName': 'iPhone 12 mini',
    'automationName': 'XCUITest',
    'app': APP,
}

driver = webdriver.Remote(APPIUM, CAPS)
driver.quit()

I was able to start a session directly from the Appium desktop app using this same desired capabilities, but when I try to run this script to start the session from there, I get this error:

from appium import webdriver
ImportError: No module named appium

Advice please, it's my first time dealing with these technologies. Thank you!

1 Answers1

1

The problem I had was I was trying to run the file using python session_ios.py; I solved it when I changed to python3 session_ios.py because it is the version of Appium that I have installed.