当前位置:   article > 正文

自动化测试PyAutoGUI 遇到的坑_typeerror: _couldnotimportpyscreeze() got an unexp

typeerror: _couldnotimportpyscreeze() got an unexpected keyword argument 'co

API文档:https://pyautogui.readthedocs.org

中文文档:https://muxuezi.github.io/posts/doc-pyautogui.html

源码:https://github.com/asweigart/pyautogui

使用方法API文档中介绍的比较详细,本文主要介绍安装和使用过程中遇到的错误。

1、pip install pyautogui,提示“UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2”

Using cached https://files.pythonhosted.org/packages/f1/54/740939161eb3471e8f7
75ce9b0fcac0e54c36bf63501e51f2cd7158f587d/PyGetWindow-0.0.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in 
File "C:\Users\tedgame\AppData\Local\Temp\pip-install-tqy3ahwx\pygetwindow
\setup.py", line 11, in 
long_description = fh.read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 905: ille
gal multibyte sequence

 

解决办法:pyautogui依赖的是pygetwindow==0.04,先pip install pygetwindow==0.0.1,再安装pyautogui

2、locateonscreen 函数无法添加confidence参数,提示TypeError: _locateAll_python() got an unexpected keyword argument 'confidence

解决办法:需要先安装opencv,方法

pip install opencv-python

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/286519
推荐阅读
相关标签
  

闽ICP备14008679号