直接运行pip install uiautomator2时,安装不了,无法访问,提示:由于目标计算机积极拒绝,无法连接。(被墙了)。
所以使用国内镜像源安装:pip install -U --pre uiautomator2 -i https://pypi.doubanio.com/simple,提示:Couldn’t find index page for ‘pbr’ (maybe misspelled?)。
提示缺少pbr模块,所以先安装pbr模块,再安装uiautomator2(另外pbr模块在线安装也是无法访问,只能离线安装)。
1、下载pbr模块:pbr下载
2、下载好pbr-5.4.4-py2.py3-none-any.whl后,使用pip install xxx/xxx/pbr-5.4.4-py2.py3-none-any.whl(该文件路径)进行安装。
3、pbr安装成功后,再执行pip install -U --pre uiautomator2 -i https://pypi.doubanio.com/simple,安装uiautomator2,即可正常安装。