Search code examples
pythonimporterrorpython-imaging-librarypyautogui

pyautogui, screenshot function doesn't recognize installed Pillow module


I want to execute this code in Pycharm

x, y = pyautogui.locateCenterOnScreen('LVL35.png')

But I get this message

ImportError: Pillow module must be installed to use screenshot functions on Windows.

The thing is, I use anaconda and Pillow is already installed and I can also find it in the Project Interpreter settings.

Requirement already satisfied: Pillow in c:\anaconda3\lib\site-packages (4.2.1)

Any idea?

enter image description here


Solution

  • That's almost a bit embarassing, but in case anyone of you has the same problem, just update your Pillow package.

    pip install Pillow --upgrade
    

    Pillow-4.2.1 was on my system, it upgraded to Pillow-5.1.0 and now everything works just fine.