安裝 要安裝PyAutoGUI,請(qǐng)pyautogui通過(guò)運(yùn)行(在Windows上)或(在macOS和Linux上)從PyPI 安裝軟件包。(在macOS和Linux上,指的是Python 2的pip工具。)pip install pyautoguipip3 install pyautoguipip 特定于操作系統(tǒng)的說(shuō)明如下。 注意:自2019年10月起,Pillow模塊不支持Python 3.8。PyAutoGUI當(dāng)前依賴(lài)于此模塊的屏幕截圖功能。 窗口在Windows上,您可以使用該py.exe程序運(yùn)行最新版本的Python: py -m pip install pyautogui
如果您安裝了Python的多個(gè)版本,則可以選擇帶有命令行參數(shù)的py。例如,對(duì)于Python 3.8,運(yùn)行: py -3.8 -m pip install pyautogui
(這與運(yùn)行相同。)pip install pyautogui
MACOS 在macOS和Linux上,您需要運(yùn)行python3: python3 -m pip install pyautogui
如果您正在運(yùn)行El Capitan并在安裝pyobjc時(shí)遇到問(wèn)題,請(qǐng)嘗試: MACOSX_DEPLOYMENT_TARGET=10.11 pip install pyobjc
Linux的在macOS和Linux上,您需要運(yùn)行python3: python3 -m pip install pyautogui
在Linux上,此外,您需要安裝scrot應(yīng)用程序以及Tkinter: sudo apt-get install scrot sudo apt-get install python3-tk sudo apt-get install python3-dev
PyAutoGUI安裝它依賴(lài)的模塊,包括PyTweening,PyScreeze,PyGetWindow,PymsgBox和MouseInfo。
|