[Android自动化] 在 pip-9.0.1 版本情况下安装 uiautomator2 报错的解决办法
1、在命令窗口中使用命令: pip install uiautomator2 时报 pip 版本过低,需要先升级 pip 版本,理论上会按照提示进行升级 pip 操作,但执行升级命令时到最后却还是报错,仍提示 pip 版本过低

解决办法:
直接先在命令窗口中执行命令: python -m pip install --upgrade pip setuptools wheel 待提示成功安装即可
Installing collected packages: setuptools, wheel
Found existing installation: setuptools 28.8.0
Uninstalling setuptools-28.8.0:
Successfully uninstalled setuptools-28.8.0
Successfully installed setuptools-40.0.0 wheel-0.31.1
此时再安装 uiautomator2 即可成功(都不需要升级 pip 版本号)
C:\Users\xx00>pip install uiautomator2
Collecting uiautomator2
c:\python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\requests\packages\urllib3\util\ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
c:\python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\requests\packages\urllib3\util\ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Collecting retry>=0.9.2 (from uiautomator2)
Using cached https://files.pythonhosted.org/packages/4b/0d/53aea75710af4528a25ed6837d71d117602b01946b307a3912cb3cfcbcba/retry-0.9.2-py2.py3-none-any.whl
Collecting humanize (from uiautomator2)
Collecting whichcraft (from uiautomator2)
Using cached https://files.pythonhosted.org/packages/60/8a/5c52e30e11672f7e3aa61f348ddae443d122bcd96bc8b785ac76dbae944b/whichcraft-0.4.1-py2.py3-none-any.whl
Collecting fire (from uiautomator2)
Collecting six (from uiautomator2)
Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting progress>=1.3 (from uiautomator2)
Collecting requests>=2.7.0 (from uiautomator2)
Using cached https://files.pythonhosted.org/packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl
Collecting decorator>=3.4.2 (from retry>=0.9.2->uiautomator2)
Using cached https://files.pythonhosted.org/packages/bc/bb/a24838832ba35baf52f32ab1a49b906b5f82fb7c76b2f6a7e35e140bac30/decorator-4.3.0-py2.py3-none-any.whl
Collecting py<2.0.0,>=1.4.26 (from retry>=0.9.2->uiautomator2)
Using cached https://files.pythonhosted.org/packages/f3/bd/83369ff2dee18f22f27d16b78dd651e8939825af5f8b0b83c38729069962/py-1.5.4-py2.py3-none-any.whl
Collecting urllib3<1.24,>=1.21.1 (from requests>=2.7.0->uiautomator2)
Using cached https://files.pythonhosted.org/packages/bd/c9/6fdd990019071a4a32a5e7cb78a1d92c53851ef4f56f62a3486e6a7d8ffb/urllib3-1.23-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.7.0->uiautomator2)
Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests>=2.7.0->uiautomator2)
Using cached https://files.pythonhosted.org/packages/7c/e6/92ad559b7192d846975fc916b65f667c7b8c3a32bea7372340bfe9a15fa5/certifi-2018.4.16-py2.py3-none-any.whl
Collecting idna<2.8,>=2.5 (from requests>=2.7.0->uiautomator2)
Using cached https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl
Installing collected packages: decorator, py, retry, humanize, whichcraft, six, fire, progress, urllib3, chardet, certifi, idna, requests, uiautomator2
Found existing installation: py 1.4.20
Uninstalling py-1.4.20:
Successfully uninstalled py-1.4.20
Found existing installation: urllib3 1.8.2
Uninstalling urllib3-1.8.2:
Successfully uninstalled urllib3-1.8.2
Found existing installation: requests 2.3.0
Uninstalling requests-2.3.0:
Successfully uninstalled requests-2.3.0
Successfully installed certifi-2018.4.16 chardet-3.0.4 decorator-4.3.0 fire-0.1.3 humanize-0.5.1 idna-2.7 progress-1.4 py-1.5.4 requests-2.19.1 retry-0.9.2 six-1.11.0 uiautomator2-0.1.2 urllib3-1.23 whichcraft-0.4.1
Traceback (most recent call last):
File "C:\Python27\Scripts\pip-script.py", line 9, in <module>
load_entry_point('pip==9.0.1', 'console_scripts', 'pip')()
File "c:\python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\__init__.py", line 233, in main
return command.main(cmd_args)
File "c:\python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\basecommand.py", line 252, in main
pip_version_check(session)
File "c:\python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\utils\outdated.py", line 102, in pip_version_check
installed_version = get_installed_version("pip")
File "c:\python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\utils\__init__.py", line 838, in get_installed_version
working_set = pkg_resources.WorkingSet()
File "c:\python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\pkg_resources\__init__.py", line 644, in __init__
self.add_entry(entry)
File "c:\python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\pkg_resources\__init__.py", line 700, in add_entry
for dist in find_distributions(entry, True):
File "c:\python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\pkg_resources\__init__.py", line 1949, in find_eggs_in_zip
if metadata.has_metadata('PKG-INFO'):
File "c:\python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\pkg_resources\__init__.py", line 1463, in has_metadata
return self.egg_info and self._has(self._fn(self.egg_info, name))
File "c:\python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\pkg_resources\__init__.py", line 1823, in _has
return zip_path in self.zipinfo or zip_path in self._index()
File "c:\python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\pkg_resources\__init__.py", line 1703, in zipinfo
return self._zip_manifests.load(self.loader.archive)
File "c:\python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\pkg_resources\__init__.py", line 1643, in load
mtime = os.stat(path).st_mtime
WindowsError: [Error 2] : 'C:\\Python27\\lib\\site-packages\\urllib3-1.8.2-py2.7.egg'
此时再同时查看 uiautomator 和 uiautomator2的版本号,确认两个安装情况(显示如下即为成功)
C:\Users\xxoo>pip show uiautomator
Name: uiautomator
Version: 0.1.32
Summary: Python Wrapper for Android UiAutomator test tool
Home-page: https://github.com/xiaocong/uiautomator
Author: youwei deng
Author-email: xiaocong@gmail.com
License: MIT
Location: c:\python27\lib\site-packages\uiautomator-0.1.32-py2.7.egg
Requires: urllib3
You are using pip version 9.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command. C:\Users\xxoo>pip show uiautomator2
Name: uiautomator2
Version: 0.1.2
Summary: Python Wrapper for Android UiAutomator2 test tool
Home-page: https://github.com/codeskyblue/uiautomator2
Author: codeskyblue
Author-email: codeskyblue@gmail.com
License: MIT
Location: c:\python27\lib\site-packages
Requires: retry, humanize, whichcraft, fire, six, progress, requests
You are using pip version 9.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
[Android自动化] 在 pip-9.0.1 版本情况下安装 uiautomator2 报错的解决办法的更多相关文章
- window下安装redis报错: creating server tcp listening socket 127.0.0.1:6379: bind No error
window下安装redis报错: creating server tcp listening socket 127.0.0.1:6379: bind No error 解决: 如果没有配置环境,在安 ...
- centos7编译安装LNMP(nginx-1.16.0,mysql8.0.16,php-7.3.6)常见问题报错及解决方法
LNMP的安装与配置 nginx-1.16.0安装及配置: 第一步:前往官网下载nignx源码包 下载完毕后上传至服务器(先安装lrzsz) yum -y install lrzsz 安装完毕后执行: ...
- vue1.0中$index一直报错的解决办法
原文链接:https://www.cnblogs.com/liqiong-web/p/8144925.html 看学习视频,因为年份比较早了,其实vue早已迭代到vue2.0了,遇到一些问题: v-f ...
- Eclipse中利用JSP把mysql-connector-java-8.0.13.jar放到WebContent\WEB-INF\lib中连接MySQL数据库时Connection conn = DriverManager.getConnection(url,username,password)报错的解决办法
开发环境: 1.系统:windows 7/8/10均可 2.jdk:1.8.0_144 3.服务器:apache-tomcat-9.0.8 4.IDE:eclipse+jsp 0.网页代码如下: &l ...
- TensorFlow 安装报错的解决办法(安装1.5版本)
1.安装Anaconda 百度下载windows版本,一路点下一步,安装好了Anaconda,自带python3.6.6. 2.安装TensorFlow (1)打开Anaconda Prompt,输入 ...
- ASP.NET CORE MVC 2.0 项目中引用第三方DLL报错的解决办法 - InvalidOperationException: Cannot find compilation library location for package
目前在学习ASP.NET CORE MVC中,今天看到微软在ASP.NET CORE MVC 2.0中又恢复了允许开发人员引用第三方DLL程序集的功能,感到甚是高兴!于是我急忙写了个Demo想试试,我 ...
- 【bug】vue-cli 3.0报错的解决办法
先上bug图片 bug说明:初装vue_cli3.0写了个组件,运行错误,显示如图, 代码提示:[Vue warn]: You are using the runtime-only build of ...
- 记一次用pip安装docker-compose报错及解决方法
Docker-Compose 的安装 方法一 # 下载1.25.0 docker compose sudo curl -L "https://github.com/docker/compos ...
- android 程序中res/values-v14/styles.xml报错的解决办法
从旧的ADT迁移的新的ADT时, android 程序中res/values-v14/styles.xml报错: error: Error retrieving parent for item: No ...
随机推荐
- .NET平台开源文档与报表处理组件包括Execel PDF Word等
在前2篇文章这些.NET开源项目你知道吗?让.NET开源来得更加猛烈些吧 和这些.NET开源项目你知道吗?让.NET开源来得更加猛烈些吧!(第二辑)中,大伙热情高涨.再次拿出自己的私货,在.NET平台 ...
- 第17课-数据库开发及ado.net 聚合函数,模糊查询like,通配符.空值处理.order by排序.分组group by-having.类型转换-cast,Convert.union all; Select 列 into 新表;字符串函数;日期函数
第17课-数据库开发及ado.net 聚合函数,模糊查询like,通配符.空值处理.order by排序.分组group by-having.类型转换-cast,Convert.union all; ...
- Tomcat Connector原理
Tomcat工作原理 要了解其中的工作原理我们首先看如下两个图 Tomcat基本架构图: Tomcat请求示意图: 客户端的请求通过Connector接受处理后在到容器Engine->Host- ...
- Selenium使用总结(Java版本)
硒在最近的发展中被广泛应用,因为它以前没有被使用过,并且已经走了太多的坑.这是一张唱片. 1.环境配置 配置要点: 1.Web驱动程序应该与浏览器版本相对应,chrome使用chrome驱动程序和ch ...
- Spring Security(二)
Spring Security(二) 注:凡是源码部分,我已经把英文注释去掉了,有兴趣的同学可以在自己项目里进去看看.:-) 定义用户认证逻辑 用户登录成功后,用户的信息会被 Security 封装在 ...
- ORM--Entity Framework 学习(01)
关键词:Entity Framework:微软官方提供的ORM工具,ORM让开发人员节省数据库访问的代码时间,将更多的时间放到业务逻辑层代码上.EF提供变更跟踪.唯一性约束.惰性加载.查询事物等.开发 ...
- ElasticSearch 使用小结
写在前面 要做个元数据服务,包括存储和查询.元数据除了一些基本字段外,其他格式是自由的,存储输入为一个JSON形式.比如下面是一个文件对象的元数据: { "name":" ...
- PHP获取本周的每一天的时间
1.PHP获取未来一周的时间 public function getWeek() { for($i=0;$i<7;$i++) { $arr[$i]=date('Y-m-d',strtotime( ...
- python中的赋值与深浅拷贝的区别
import copy lt = [1, 2, [3, 4]] # 赋值会增加一个引用,访问的都是同一数据 # lt2 = lt # 浅拷贝:只拷贝对象本身,里面的元素只会增加一个引用 lt2 = l ...
- nginx深入剖析
1.nginx功能模块说明 nginx之所以很强大,是因为具有很多的强大的模块 nginx核心功能模块:nginx的核心功能模块负责nginx的全局应用,主要对应的是主配置文件中的Main区块和Eve ...