安装uiautomator2提示Running setup.py install for lxml did not run successfully.安装weditor提示egg_info失败

1.环境:

windows系统 + jdk 17 + adb 29.0.6-6198805 

2.安装uiautomator2问题

pip install -U uiautomator2 

ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: 'C:\\Python311\\Scripts\\readelf.py'
Consider using the `--user` option or check the permissions.

使用pip install --pre --user uiautomator2

再次失败,提示

Running setup.py install for lxml did not run successfully.

...

 Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?

通过这两个关键问题,我开始寻找解决问题的方法,不断失败,two thousand years later。。。

解决方法:

 使用pip进行离线安装lxml,先通过如下网址下载whl文件

Archived: Python Extension Packages for Windows - Christoph Gohlke (uci.edu)

(1)在命令窗口使用使用 python --version 确认python版本号

(2)下载对应版本,我的是3.11.0windows系统64位

安装uiautomator2提示Running setup.py install for lxml did not run successfully.安装weditor提示egg_info失败_第1张图片

(3) 打开whl文件所在的文件夹,在路径中输入cmd,然后再输入命令

pip install lxml-4.9.0-cp311-cp311-win_amd64.whl

立即提示安装成功:

 (4)再重新安装uiautomator2:pip install --pre --user uiautomator2 成功!!

3.安装weditor的问题

pip install --user weditor

提示 python setup.py egg_info did not run successfully.

在一个博客评论区找到了解决方法;

0.6.5的版本有问题,设置版本为0.6.4解决问题。
pip install --pre --upgrade weditor==0.6.4

参考文章:

https://blog.csdn.net/li2642530979/article/details/106334797

https://blog.csdn.net/technologist_41/article/details/123212212

你可能感兴趣的:(python,测试工具,windows)