Python pyautogui.click is right clicking instead of left clicking

Viewed 3508

I'm using python3 through Anaconda Jupyter Notebook on macOS Mojave 10.14.1.

When I use pyautogui.click() in my code, it right clicks instead of left clicking like it should.

Even if I add pyautogui.click(button='left'), it still right clicks.

The same happens if I use pyautogui.mouseDown().

Any idea what's going wrong or how to fix it?

1 Answers

I solved this by declaring button=2 in the arguments:

pyautogui.click(button=2)
Related