'pyautogui, locate on screen doen't work in linux

I am using linux, and it returns none instead of the co-ordinates.

import pyautogui as p

a=p.locateCenterOnScreen('like.png',confidence=.5)

print(a)

Did I did something wrong while locating file or what is wrong? The image is perfectly cropped but also it always returns none. the 'like.png' file is in the same directory with source code..should I put that image file in another directory for it to work,if yes then which directory?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source