运行pyautogui.locateCenterOnScreen(r'C:\Users\Administrator\desktop\python\bjh_zhijiefabu.png' , grayscale=False, confidence=0.7),会弹出错误,TypeError: _locateAll_python() got an unexpected keyword argument 'confidence’。
原因是少组件
“pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python”,安装好opencv-python。就可以解决问题
————————————————
版权声明:本文为优快云博主「hjm4702192」的原创文章
文章讲述了在使用pyautogui函数时遇到的TypeError,原因是在调用locateCenterOnScreen时缺少confidence参数。解决方法是通过pip从清华大学源安装opencv-python。这是优快云博主hjm4702192的原创内容。
3570





