进入Anaconda prompt,使用
conda install uiautomator2
出现PackagesNotFoundError: The following packages are not available from current channels:
接着使用
anaconda search -t conda uiautomator2
发现搜索结果为空,于是放弃,进入cmd,使用
pip install --upgrade --pre uiautomator2
发现下载极慢,出现超时错误requests.packages.urllib3.exceptions.ReadTimeoutError:
于是设置默认超时时间
pip --default-timeout=100 install uiautomator2
终于安装成功,但出现警告:
WARNING: The script uiautomator2.exe is installed in 'C:\Users\luojie\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
可是正常使用,但发现这个库安装到了python路径,而不是anaconda路径,于是找到已下载的whl文件,按照