[Python] Pillow is installed, but getting 'No module named pil'

Discussão em 'Python' iniciado por Stack, Setembro 10, 2025.

  1. Stack

    Stack Membro Participativo

    I installed Pillow using pip with pip install pillow. I got the message that pillow was successfully installed, but when I try and import it in IDLE, I get the error:

    Traceback (most recent call last):
    File "<pyshell#1>", line 1, in <module>
    from pil import image
    ModuleNotFoundError: No module named 'pil'


    I have tried "PIL" as well as "Pillow" and import pil.

    I tried uninstalling and reinstalling python completely, as well as uninstalling pillow and reinstalling it with python3 -m pip install --upgrade Pillow.

    I also ran

    import sys
    print(sys.executable)


    and then used -target to install to that path's site-packages. Still doesn't work. Driving me insane.

    Continue reading...

Compartilhe esta Página