I am working in python IDLE shell and for some reason pyautogui.locateOnScreen won’t work.
Here is my code:
from pyautogui import *
import pyscreeze
import pyautogui
import time
import keyboard
import random
import win32api, win32con
while 1:
if pyautogui.locateOnScreen('Dassault Falcon 7X.png', confidence=0.8) != None:
print ("I can see it!")
time.sleep(0.5)
else:
print ("Nope nothing there")
And for some reason I keep getting the error message:
File "D:PythonLibsite-packagespyscreeze__init__.py", line 17, in <module>
from PIL import Image
ModuleNotFoundError: No module named 'PIL'
I tried installing pillow but it said it already had. I was expecting it to start printing either “I can see it!” or “Nope nothing there.
New contributor
MMewtwo Porro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.