折腾:
【未解决】给安卓手机小米9中欢乐大作战的游戏实现自动挂机
期间,去mac中用pipenv去安装uiautomator2:
➜ autoTestAndroidGameHappyBigBattle pipenv install uiautomator2 Installing uiautomator2… Adding uiautomator2 to Pipfile's [packages]… ✔ Installation Succeeded Pipfile.lock not found, creating… Locking [dev-packages] dependencies… Locking [packages] dependencies… ⠴ Locking...
很慢,要等待。
继续等待。
等待几十分钟了,受不了了,中断:
Locking [packages] dependencies… ✘ ^C
加上跳过lock
➜ autoTestAndroidGameHappyBigBattle pipenv install uiautomator2 --skip-lock Installing uiautomator2… ⠋ Installing...
pipenv skip lock
2018.11.14 regression: `pipenv install –dev –skip-lock` fails on non-targeted Python versions · Issue #3282 · pypa/pipenv
Pipenv:新一代Python项目环境与依赖管理工具 – 知乎
人家说了:“UPDATE(2019/8/31):不要用 Pipenv”
估计也是locking太久,偶尔死掉的原因
不要用 Pipenv – 知乎
Basic Usage of Pipenv — pipenv 2018.11.27.dev0 documentation
“* –skip-lock — Ignore the Pipfile.lock and install from the Pipfile. In addition, do not write out a Pipfile.lock reflecting changes to the Pipfile.”
Provide persistent skip-lock option · Issue #2200 · pypa/pipenv
有人说是:
可以给Pipfile中加上:
skip_lock = true
去试试
结果:
还是慢死了
参考
去换源
Pipfile
[[source]] name = "pypi" # url = "https://pypi.org/simple" url = "https://mirrors.aliyun.com/pypi/simple" verify_ssl = true skip_lock = true [dev-packages] [packages] uiautomator2 = "*" [requires] python_version = "3.7"
结果:
➜ autoTestAndroidGameHappyBigBattle pipenv install uiautomator2 Installing uiautomator2… Adding uiautomator2 to Pipfile's [packages]… ✔ Installation Succeeded Pipfile.lock not found, creating… Locking [dev-packages] dependencies… Locking [packages] dependencies… ⠸ Locking...
竟然还是locking
打算中断,加上跳过lock,结果瞬间完成了:
➜ autoTestAndroidGameHappyBigBattle pipenv install uiautomator2 Installing uiautomator2… Adding uiautomator2 to Pipfile's [packages]… ✔ Installation Succeeded Pipfile.lock not found, creating… Locking [dev-packages] dependencies… Locking [packages] dependencies… ✔ Success! Updated Pipfile.lock (78903d)! Installing dependencies from Pipfile.lock (78903d)… 🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 22/22 — 00:00:07
终于安装成功了。。。
【总结】
此处可以考虑,先建一个Pipfile文件:
[[source]] name = "pypi" # url = "https://pypi.org/simple" url = "https://mirrors.aliyun.com/pypi/simple" verify_ssl = true skip_lock = true [dev-packages] [packages] uiautomator2 = "*" [requires] python_version = "3.7"
然后去安装:
pipenv install uiautomator2
或:
pipenv install uiautomator2 --skip-lock
即可。
注:可能还是要等很长时间。。。
转载请注明:在路上 » 【记录】mac中用pipenv安装uiautomator2