由于某种原因,我在屏幕上找不到,错误看起来像这样;
Traceback (most recent call last):
File "C:\Users\centr\PycharmProjects\phoenix\whatsapp\main.py", line 7, in <module>
position1 = pt.locateOnScreen('whatsapp/smiley_paperclip.png')
File "C:\Users\centr\PycharmProjects\phoenix\venv\lib\site-packages\pyautogui\_init_.py", line 175, in wrapper
return wrappedFunction(*args, **kwargs)
File "C:\Users\centr\PycharmProjects\phoenix\venv\lib\site-packages\pyautogui\_init_.py", line 213, in locateOnScreen
return pyscreeze.locateOnScreen(*args, **kwargs)
File "C:\Users\centr\PycharmProjects\phoenix\venv\lib\site-packages\pyscreeze\_init_.py", line 371, 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\centr\PycharmProjects\phoenix\venv\lib\site-packages\pyscreeze\_init_.py", line 143, 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,它表明已经安装并且错误仍然存在。
我通过卸载枕头 8.3.0 并安装枕头 8.0.0 来修复它。