nugget 1
nugget 1

Reputation: 43

PyAutoGUI was unable to import pyscreeze

my code:

import pyautogui
from time import sleep
x, y = pyautogui.locateOnScreen("slorixsh.png", confidence=0.5)

error:

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    x, y = pyautogui.locateOnScreen("slorixsh.png", confidence=0.5)
  File "C:\Users\mrnug\AppData\Local\Programs\Python\Python310\lib\site-packages\pyautogui\__init__.py", line 231, 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.

line 231 in that error:

 raise 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."
        )

somehow it doesnt work i just reinstalled and updated that modules:

pyscreeze, opencv, pyautogui, pillow

Upvotes: 4

Views: 31495

Answers (2)

akebono
akebono

Reputation: 11

pip install pillow

solved the issue for me

Upvotes: 1

Christian Balinda
Christian Balinda

Reputation: 96

Yeah, you can fix it by this

pip install pyscreeze

import pyscreeze
import time

time.sleep(5)
x, y = pyscreeze.locateOnScreen("slorixsh.png", confidence=0.5)

Upvotes: 8

Related Questions