python - Python 给了我很多回溯的东西是怎么回事
问题描述
这是我的代码
from pyautogui import *
import pyautogui
import time
import keyboard
import random
import win32api, win32con
while (1):
if pyautogui.locateOnScreen('stickman.png', region=(150,175,350,600), grayscale=True, confidence=0.8) != None:
print("I can see it")
time.sleep(0.5)
else:
print("I am unable to see it")
time.sleep(0.5)
追溯:
Traceback (most recent call last):
File "C:\Users\TheJa\OneDrive\Desktop\test.py", line 9, in <module>
if pyautogui.locateOnScreen('stickman.png', region=(150,175,350,600), grayscale=True, confidence=0.8) != None:
File "C:\Users\TheJa\AppData\Local\Programs\Python\Python39\lib\site-packages\pyautogui\__init__.py", line 175, in wrapper
return wrappedFunction(*args, **kwargs)
File "C:\Users\TheJa\AppData\Local\Programs\Python\Python39\lib\site-packages\pyautogui\__init__.py", line 213, in locateOnScreen
return pyscreeze.locateOnScreen(*args, **kwargs)
File "C:\Users\TheJa\AppData\Local\Programs\Python\Python39\lib\site-packages\pyscreeze\__init__.py", line 359, in locateOnScreen
screenshotIm = screenshot(region=None) # the locateAll() function must handle cropping to return accurate coordinates, so don't pass a region here.
File "C:\Users\TheJa\AppData\Local\Programs\Python\Python39\lib\site-packages\pyscreeze\__init__.py", line 134, in wrapper
raise PyScreezeException('The Pillow package is required to use this function.')
pyscreeze.PyScreezeException: The Pillow package is required to use this function.
解决方案
推荐阅读
- css - 如何将border-radius CSS属性添加到下拉蚂蚁设计元素?
- android - 某些设备上的视频冻结问题 ExoPlayer
- r - 在 R studio 中安装简单包时出现警告
- java - 如何比较两个服务的数据,哪个应该做同样的事情?
- gtk - GtkD 功能无法正确显示菜单
- r - 从 R 中的复杂调查设计中抽取样本
- reactjs - 使用 axios 自定义 http 钩子
- javascript - Javascript检测一个词是否是一个词
- amazon-web-services - AWS CloudFormation:Application Load Balancer 的目标组不适用于多个 EC2 实例
- reactjs - 如何在 Ag-Grid React 的列标题中添加全选复选框?