|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import pyautogui
import time
from pyautogui import moveTo as MoveTo
from time import sleep as Delay
from pyautogui import click as LeftClick
while True:
cj=pyautogui.locateOnScreen("d.png")
if cj is not None:
print(cj)
MoveTo(1615, 838)
Delay (1000)
LeftClick()
MoveTo(1648, 360)
Delay(15000)
LeftClick()
其他电脑运行没问题,但是有一台运行后报错
cj=pyautogui.locateOnScreen("d.png")这句
Traceback (most recent call last):
File "D:\新建文件夹 (3)\mh.py", line 8, in <module>
cj=pyautogui.locateOnScreen("d.png")
File "C:\Users\79387\AppData\Local\Programs\Python\Python310\lib\site-packages\pyautogui\__init__.py", line 175, in wrapper
return wrappedFunction(*args, **kwargs)
File "C:\Users\79387\AppData\Local\Programs\Python\Python310\lib\site-packages\pyautogui\__init__.py", line 213, in locateOnScreen
return pyscreeze.locateOnScreen(*args, **kwargs)
File "C:\Users\79387\AppData\Local\Programs\Python\Python310\lib\site-packages\pyscreeze\__init__.py", line 372, 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\79387\AppData\Local\Programs\Python\Python310\lib\site-packages\pyscreeze\__init__.py", line 144, in wrapper
raise PyScreezeException('The Pillow package is required to use this function.')
pyscreeze.PyScreezeException: The Pillow package is required to use this function. |
|