最近在研究app自动化uiautomator2,在安装时pip install --pre uiautomator2 时报time out这个错,
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files .pythonhosted.org',port=443): Read timed out.
是由于国内网络原因,python包的下载速度非常慢,查看pip 文档,只要在 pip的时候控制超时即可, 具体参数为 --default-timeout=1000, 后面的时间可以自己指定。
解决方法:
1.
pip --default-timeout=1000 install -U --pre uiautomator2
2.或者去最后去https://github.com/openatx/uiautomator2,用pip3安装,也可安装成功
需cd到python的Scripts目录,再使用pip3安装
D:\python36\Scripts>pip3 install -U uiautomator2