0

For some reason, I can't find on screen, the error looks like this;

    Traceback (most recent call last):
  File "C:\Users\centr\PycharmProjects\phoenix\whatsapp\main.py", line 7, in <module>
    position1 = pt.locateOnScreen('whatsapp/smiley_paperclip.png')
  File "C:\Users\centr\PycharmProjects\phoenix\venv\lib\site-packages\pyautogui\_init_.py", line 175, in wrapper
    return wrappedFunction(*args, **kwargs)
  File "C:\Users\centr\PycharmProjects\phoenix\venv\lib\site-packages\pyautogui\_init_.py", line 213, in locateOnScreen
    return pyscreeze.locateOnScreen(*args, **kwargs)
  File "C:\Users\centr\PycharmProjects\phoenix\venv\lib\site-packages\pyscreeze\_init_.py", line 371, in locateOnScreen
    screenshotIm = screenshot(region=None) # the locateAll() function must handle cropping to return accurate coordinates, so don't pass a region here.
  File "C:\Users\centr\PycharmProjects\phoenix\venv\lib\site-packages\pyscreeze\_init_.py", line 143, in wrapper
    raise PyScreezeException('The Pillow package is required to use this function.')
pyscreeze.PyScreezeException: The Pillow package is required to use this function.

If I try to install the Pillow, it shows that is already installed and the error continues.

I fixed it by uninstalling the Pillow 8.3.0 and installing the pillow 8.0.0.

GabsLeo
  • 1
  • 2

1 Answers1

1

Great question! What you need to do is upgrade Pillow. This will stop the error from occurring. Please follow the steps listed below:

  1. First, open command prompt on Windows. to do this, click the Windows key and type: "cmd." This will bring up a Windows terminal that will allow you to fix Pillow.

  2. After command prompt has been opened type in this exactly:

pip install Pillow --upgrade

This should execute a command that will upgrade Pillow and stop Pyautogui from presenting this error again.

And that's it! Pyautogui shouldn't display this error.