Modulenotfound when I try to import an external library

Asked

Viewed 14 times

-1

pip install pillow
>>> Requirement already satisfied: pillow in c:\users\miguel\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (8.3.1)
import pillow
>>> Traceback (most recent call last):
  File "C:\Users\Miguel\PycharmProjects\Testing\main\__init__.py", line 1, in <module>
    import pillow
ModuleNotFoundError: No module named 'pillow'

for some reason I always get that error when I try to import an external library, even after downloading it. tried to search but no results. does anyone know the reason for this error?

1 answer

0

If the library is for image manipulation the correct is:

Installation

pip install Pillow

Note Pillow with the letter P capitalized.

Carrying

import PIL

or

from PIL import Image

Browser other questions tagged

You are not signed in. Login or sign up in order to post.