Sy_松 发表于 2018-12-19 11:57:43

appium+python自动化测试:ImportError: No module named extensions.context

手机端自动化测试 appium+python+模拟器的环境
demo:
#coding=utf-8

import time
import os
from appium import webdriver

desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '7.0'
desired_caps['deviceName'] = 'emulator-5554'
desired_caps['appPackage'] = 'com.android.launcher3'
desired_caps['appActivity'] = '.Launcher t7'

driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
运行的后报错:
Traceback (most recent call last):
File "/Users/hhht/PycharmProjects/untitled1/demo.py", line 5, in <module>
    from appium import webdriver
File "/Users/hhht/untitled1/lib/python2.7/site-packages/appium/webdriver/__init__.py", line 19, in <module>
    from .webdriver import WebDriver as Remote
File "/Users/hhht/untitled1/lib/python2.7/site-packages/appium/webdriver/webdriver.py", line 31, in <module>
    from .extensions.context import Context
ImportError: No module named extensions.context

qqq911 发表于 2019-3-8 10:55:56

引入有问题

jingzizx 发表于 2019-3-8 12:32:58

查看引入报是否正确

abcsell 发表于 2019-3-8 13:40:49

缺少模块,重新安装下
页: [1]
查看完整版本: appium+python自动化测试:ImportError: No module named extensions.context