I've been struggling with this issue already for a few days but I can't manage to fix it. So I have the following code
import pyautogui
from pyautogui import locateOnScreen, press, click
from time import sleep
import pydirectinput
import keyboard
button_location = locateOnScreen("button.png", confidence="0.7")
And I get the following error:
TypeError: _locateAll_python() got an unexpected keyword argument 'confidence'
I've literally installed and uninstalled a lot of python versions (2.7, 3.6, 3.7, 3.8, 3,9) but I always get the same error. I use the following commands to install the packages:
pip install pyautogui
pip install opencv-python
And just in case, it's a Windows machine with an i5.