Estou no capítulo final de Automate the Boring Stuff with Python - O Capítulo 20 começa instalando e importando o pyautogui, e não consegui fazer isso. EU CONSEGUI instalar o módulo no meu Mac, NÃO consegui adicionar isso como um Módulo de Terceiros no Mu Editor. Aqui está o erro que recebo quando tento adicionar isso como um módulo no Mu Editor:
Collecting pyautogui
Using cached PyAutoGUI-0.9.54.tar.gz (61 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting pygetwindow>=0.0.5
Using cached PyGetWindow-0.0.9.tar.gz (9.7 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting mouseinfo
Using cached MouseInfo-0.1.3.tar.gz (10 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting pymsgbox
Using cached PyMsgBox-1.0.9.tar.gz (18 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting pyobjc-framework-quartz
Using cached pyobjc_framework_Quartz-10.3.2-cp38-cp38-macosx_11_0_universal2.whl (211 kB)
Collecting pyobjc-core
Using cached pyobjc_core-11.0.tar.gz (994 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [2 lines of output]
<string>:18: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
PyObjC: Need at least Python 3.9
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
FINISHED
Consegui instalar o pyautogui com sucesso no meu Mac usando: pip3 install pyautogui
Estou usando python3.9 Estou no macOS Sequia 15.3.1
Mas quando tento adicionar isso como um pacote de terceiros ao Mu Editor, ele sai com o erro acima.
Eu vasculhei a internet em busca de respostas e tentei:
- reiniciando
- desinstalando e reinstalando pyautogui e pyobjc
- instalando pyautogui como administrador
- Seguindo a url para https://setuptools.pypa.io/en/latest/pkg_resources.htmlm (mas, para ser honesto, não entendi essa página).
Espero que a instalação seja concluída sem erros para que eu possa importá-la no REPL e praticar com o pyautogui.
Estou particularmente confuso sobre o motivo pelo qual diz PyObjC: Precisa de pelo menos Python 3.9, embora eu esteja executando o Python 3.9.6.
Por favor ajude!