换个电脑pyautogui.locateOnScreen('d.png')报错
import pyautoguiimport 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")
ifcj 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. 装一下Pillow这个模块
pip install pillow
有这个模块的话就重装一下Pillow
pip uninstall pillow
pip install pillow 临时号 发表于 2022-6-8 22:51
装一下Pillow这个模块
有这个模块的话就重装一下Pillow
pip install opencv-python
后面竟然还要装这个,之前的电脑没有这么复杂。谢谢啦
页:
[1]