Installation

To install PyAutoGUI, install thepyautogui package from PyPI by runningpipinstallpyautogui (on Windows) orpip3installpyautogui (on macOS and Linux). (On macOS and Linux,pip refers to Python 2’s pip tool.)

OS-specific instructions are below.

Windows

On Windows, you can use thepy.exe program to run the latest version of Python:

py-mpipinstallpyautogui

If you have multiple versions of Python installed, you can select which one with a command line argument topy. For example, for Python 3.8, run:

py-3.8-mpipinstallpyautogui

(This is the same as runningpipinstallpyautogui.)

macOS

On macOS and Linux, you need to runpython3:

python3-mpipinstallpyautogui

If you are running El Capitan and have problems installing pyobjc try:

MACOSX_DEPLOYMENT_TARGET=10.11pipinstallpyobjc

Linux

On macOS and Linux, you need to runpython3:

python3-mpipinstallpyautogui

On Linux, additionally you need to install thescrot application, as well as Tkinter:

sudoapt-getinstallscrot

sudoapt-getinstallpython3-tk

sudoapt-getinstallpython3-dev

PyAutoGUI install the modules it depends on, including PyTweening, PyScreeze, PyGetWindow, PymsgBox, and MouseInfo.