[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 ...
 
随机推荐
- C编程基础
			
1. Hello World! 依照惯例首先Hello World镇楼: 1 #include<stdio.h> 2 3 int main(void) { 4 printf("H ...
 - .NET平台开源文档与报表处理组件包括Execel PDF Word等
			
在前2篇文章这些.NET开源项目你知道吗?让.NET开源来得更加猛烈些吧 和这些.NET开源项目你知道吗?让.NET开源来得更加猛烈些吧!(第二辑)中,大伙热情高涨.再次拿出自己的私货,在.NET平台 ...
 - Vistual Studio 2010(VS2010)安装 MVC3.0具体方法
			
本文内容部分摘自园子里其他博主的内容,感谢他们的探索和分享,谢谢!本文主要方便自己记录自己的学习和操作过程,同时也希望能够通过搜索引擎通过不同的关键字分享该文章,以方便更多的同学. PS:VS2010 ...
 - SQL SERVER 快捷键收录
			
1.大小写转换快捷键 Ctrl+Shift+U 转为大写 Ctrl+Shift+L 转为小写
 - 24.Linux-Nand Flash驱动(分析MTD层并制作NAND驱动)
			
1.本节使用的nand flash型号为K9F2G08U0M,它的命令如下: 1.1我们以上图的read id(读ID)为例,它的时序图如下: 首先需要使能CE片选 1)使能CLE 2)发送0X90命 ...
 - Go 语言相关的优秀框架,库及软件列表
			
If you see a package or project here that is no longer maintained or is not a good fit, please submi ...
 - python学习之老男孩python全栈第九期_第一次周末考试题(over)第三次添加完毕
			
day 6python基础数据类型考试题 考试时间:两个半小时 满分100分(80分以上包含80分及格) 一,基础题. 1. 简述变量命名规范(3分) 答:(1) 变量为数字,字母以及下划线的任意组合 ...
 - Context 上下文
			
全称:context 解释:上下文,在我们的开发的程序中,通常使用context上下文. 理解:结合实际生活我们可以把它理解为是语境,比如A说:我喜欢他. 那么这个他是谁,我们不知道,如果在这句话之前 ...
 - 【读书笔记】iOS-网络-使用Bonjour实现自组织网络
			
Bonjour就是这样一种技术:设备可以通过它轻松探测并连接到相同网络中的其他设备,整个过程只需要很少的用户参与或是根本就不需要用户参与.该框架提供了众多适合于移动的使用场景,如基于网络的游戏,设备间 ...
 - js知识学习图谱,新手必看
			
前端新手学习也不外乎就是Html css html5 css3 这是最基本的,学会这些仅仅可以说是会写布局,写网页,不算前端开发,还有最重要的js,jq要学习,我自己java后台转前端,现在复 ...