I installed the Pillow
package with:
python -m pip install pillow
Got success message (Successfully installed pillow
). Closed and re-opened the terminal.
But when I try to:
import pillow
I get the error message:
ImportError: No module named pillow
If python -m pip install pillow
is run again, it says
Requirement already satisfied (use --upgrade to upgrade): pillow in c:\python27\lib\site-packages
Step 2: To check if PIL is successfully installed, open up the python terminal by typing python3 in the terminal. This will open up the python3 interactive console now type the following command to check the current version of the PIL. This will output the currently installed version of the PIL.
The Python "ModuleNotFoundError: No module named 'PIL'" occurs when we forget to install the Pillow module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install Pillow command.
To load the image, we simply import the image module from the pillow and call the Image. open(), passing the image filename. Instead of calling the Pillow module, we will call the PIL module as to make it backward compatible with an older module called Python Imaging Library (PIL).
Try using
import PIL
or
from PIL import ...
instead. Pillow
is a fork of PIL
, the Python Imaging Library, which is no longer maintained. However, to maintain backwards compatibility, the old module name is used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With