直接運行pip install uiautomator2時,安裝不了,無法訪問,提示:由於目標計算機積極拒絕,無法連接。(被牆了)。
所以使用國內鏡像源安裝:pip install -i https://pypi.doubanio.com/simple uiautomator2,提示:Couldn’t find index page for ‘pbr’ (maybe misspelled?)。
提示缺少pbr模塊,所以先安裝pbr模塊,再安裝uiautomator2(另外pbr模塊在線安裝也是無法訪問,只能離線安裝)。
1、下載pbr模塊:pbr下載:https://www.lfd.uci.edu/~gohlke/pythonlibs/#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 -i https://pypi.doubanio.com/simple uiautomator2,安裝uiautomator2,即可正常安裝。
————————————————
參考原文鏈接:https://blog.csdn.net/yangguangjian/article/details/103959005