I have a simple python script in visual studio on MacOS. Everytime I try to run it I get the following error please help!
Kyles-MacBook-Pro-12:Python brogan$ cd /Users/brogan/Desktop/Python ; /usr/bin/env /usr/local/bin/python3 /Users/brogan/.vscode/extensions/ms-python.python-2023.20.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher 56397 — /Users/brogan/Desktop/Python/AutoGUI.py
Traceback (most recent call last):
File "/Users/brogan/Desktop/Python/AutoGUI.py", line 3, in
res = pyautogui.locateOnScreen("Apple_Logo.png")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pyautogui/init.py", line 228, in _couldNotImportPyScreeze
raise PyAutoGUIException(
pyautogui.PyAutoGUIException: PyAutoGUI was unable to import pyscreeze. (This is likely because you’re running a version of Python that Pillow (which pyscreeze depends on) doesn’t support currently.) Please install this module to enable the function you tried to call.
Ive tried installing PyScreeze
Kyles-MacBook-Pro-12:Python brogan$ pip3 install PyScreeze
Requirement already satisfied: PyScreeze in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (0.1.30)
This is the response… I believe I already have it.
2
Answers
The solution for me was to install pillow.
pip3 install pillow
try installing pyscreeze
and then use the following code