I have 2 files in root
1 - setup.py
2 - img.PNG
code in setup.py is:
import pyautogui, time
print('your screen size is: ', pyautogui.size(),'\n')
time.sleep(3)
foundimage = pyautogui.locateCenterOnScreen('img.PNG', confidence=0.8)
time.sleep(3)
pyautogui.click(foundimage.x + 100, foundimage.y) #click on notes
locateOnScreen takes an argument that is in root folder named "img.PNG" when i run this code directly through vs code commandline, it runs, but when i build files through pyinstaller with following commands.
pyinstaller -F --noupx setup.py
or
pyinstaller --onefile setup.py
both commands can build my file into .exe format. but my function locateOnScreen doesn't work, means my it doesn't include my .PNG file in exe format. Any solution?