To answer my own question (now that I understand properly).

In Python, you can import:

  1. modules - single files e.g. something.py; or
  2. packages - directories containing one or more .py files, and always one file called __init__.py which designates the directory as a package

In this case, the statement:

import PIL

Is really the same as saying "import the __init__.py file in the PIL directory". In this specific case, that __init__.py file does not import or otherwise make available any class or other module called "Image", so my subsequent reference to it in example 2 in my initial post import fails.

In contrast, the statement:

from PIL import Image

is interpreted a bit differently. This is really the same as saying "look in the package directory PIL for a module called Image and import it".

So you can see that the import statement is actually a bit context dependent. It can mean different things in different circumstances.

This is an excellent resource that explains the different ways in which the import statement can function depending on context.

Answer from Lewis on Stack Overflow
🌐
PyPI
pypi.org › project › pillow
pillow · PyPI
As of 2019, Pillow development is supported by Tidelift. The Python Imaging Library adds image processing capabilities to your Python interpreter.
      » pip install pillow
    
Published   Apr 01, 2026
Version   12.2.0
Discussions

Import PIL does not work when Pillow is installed via pip
After installing, try importing in the interactive shell. In Windows terminal/command shell: py -m pip install Pillow py In the Python interactive shell, try, from PIL import Image exit() If this works, you are likely using a Python virtual environment in VS Code or working with a different version of Python. More on reddit.com
🌐 r/learnpython
12
2
February 19, 2023
Probelms with Pillow: from PIL import image // modulenotfounderror no module named 'PIL'
However upon this line: from PIL import Image I get the following error: from PIL import Image ModuleNotFoundError: No module named ‘PIL’ I have newly installed PyCharm and Python 3.11.2 and installed pillow 9.4.0. Both seem to be correctly installed as when i ask to show the location or ... More on discuss.python.org
🌐 discuss.python.org
13
0
March 21, 2023
How do I install Pillow?
You should only be using the python command, not the python3 command. Unless you're on a mac you shouldn't ever have python2 on your system. pip install pillow or python -m pip install pillow should work. When in doubt, I highly recommend using Anaconda . Just uninstall python and remove all the pathing from your PATH environment variables, then install it and add those instead. It's basically python 3.8+ that also includes a package manager for easy install of things. More on reddit.com
🌐 r/programminghelp
6
2
October 10, 2020
python - ImportError: No module named PIL - Stack Overflow
When I key "pip install Pillow" ... Pillow in c:\users\user\venv\odoo\lib\site-packages (6.2.2) 2020-05-22T14:44:35.92Z+00:00 ... instead of import PIL (PIL is in fact not always imported this way). Since import Image works for you, this means that you have in fact installed PIL. Having a different name for the library and the Python module is ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Pillow Documentation
pillow.readthedocs.io › en › stable › handbook › tutorial.html
Tutorial - Pillow (PIL Fork) 12.2.0 documentation
from PIL import ImageSequence for frame in ImageSequence.Iterator(im): # ...do something to frame... The Python Imaging Library includes functions to print images, text and graphics on PostScript printers.
🌐
Reddit
reddit.com › r/learnpython › import pil does not work when pillow is installed via pip
r/learnpython on Reddit: Import PIL does not work when Pillow is installed via pip
February 19, 2023 -

I'm coding a music player in python for learning and I see that PIL needs to be used for the "Logo.png" error (which I have the .png file for it). But the "Import PIL" doesn't work and spits out the "couldn't be resolved" error. Even though I have installed Pillow (and upgraded it). I'm using the Tkinter module for this project btw. Another thought I had was bypassing the PIL/Pillow module entirely and creating a more primitive version just to import images. But I haven't found any related instructions on getting python to recognize image files, especially for importing to projects.

🌐
Pillow Documentation
pillow.readthedocs.io › en › stable › reference › Image.html
Image module - Pillow (PIL Fork) 12.2.0 documentation
Note: Prior to Pillow 3.4.0, this was a lazy operation. ... An Image object. This crops the input image with the provided coordinates: from PIL import Image with Image.open("hopper.jpg") as im: # The crop method from the Image module takes four coordinates as input.
Find elsewhere
🌐
St. Olaf College
wp.stolaf.edu › it › installing-pil-pillow-cimage-on-windows-and-mac
Installing PIL/Pillow/cImage for Python on Windows and Mac – Information Technology
June 10, 2016 - PIL (Python Imaging Library) adds many image processing features to Python. Pillow is a fork of PIL that adds some user-friendly features. cImage.py is a Python module used for image processing. Install Python 2.7.8 (64-bit — this is important)
🌐
TutorialsPoint
tutorialspoint.com › python_pillow › python_pillow_using_image_module.htm
Python Pillow - Using Image Module
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 ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-pillow-a-fork-of-pil
Python: Pillow (a fork of PIL) - GeeksforGeeks
April 28, 2025 - Therefore, due to the conversion of the image format to .png some properties of the original image file format might be lost (like animation). Therefore, it is advised to use this method only for test purposes. Python3 · from PIL import Image img ...
🌐
Anaconda.org
anaconda.org › anaconda › pillow
pillow - anaconda | Anaconda.org
March 2, 2026 - Pillow is the friendly PIL fork. PIL is the Python Imaging Library, adds image processing capabilities to your Python interpreter.
🌐
Reddit
reddit.com › r/programminghelp › how do i install pillow?
r/programminghelp on Reddit: How do I install Pillow?
October 10, 2020 - You should only be using the python command, not the python3 command. Unless you're on a mac you shouldn't ever have python2 on your system. pip install pillow or python -m pip install pillow should work.
🌐
Codecademy
codecademy.com › article › getting-started-with-image-processing-in-python-using-pillow
Getting Started with Image Processing in Python using Pillow | Codecademy
Though the library is commonly called “Pillow,” the package name remains “PIL”. That’s why we are using from PIL import Image instead of from Pillow import Image.
🌐
Compciv
2017.compciv.org › guide › topics › python-nonstandard-libraries › pillow.html
Pillow - Python Imaging Library (aka PIL)
from PIL import Image fname = 'trump.jpg' img = Image.open(fname) destname = 'trump-copy.jpg' img.save(destname) ... Image.save() documentation: http://pillow.readthedocs.io/en/latest/reference/Image.html#PIL.Image.Image.save
🌐
Wikipedia
en.wikipedia.org › wiki › Python_Imaging_Library
Python Imaging Library - Wikipedia
4 days ago - Subsequently, a successor project named Pillow forked the PIL repository and added Python 3.x support. This fork has been adopted as a replacement for the original PIL in Linux distributions including Debian and Ubuntu (since 13.04). PIL offers several standard procedures for image manipulation. These include: ... Supported file formats include PPM, PNG, JPEG, GIF, TIFF, and BMP. PIL is extensible, allowing users to create custom decoders for any file format. import os from PIL import Image def convert_jpegs_to_pngs(folder_path): # Checks if the provided path is a folder if not os.path.isdir(f
🌐
Porkbun
python-pillow.org
Pillow
python-pillow.org has been registered at Porkbun but the owner has not put up a site yet. Visit again soon to see what amazing website they decide to build
🌐
GitHub
github.com › python-pillow › Pillow
GitHub - python-pillow/Pillow: Python Imaging Library (fork) · GitHub
As of 2019, Pillow development is supported by Tidelift. ... The Python Imaging Library adds image processing capabilities to your Python interpreter.
Starred by 13.5K users
Forked by 2.4K users
Languages   Python 63.8% | C 35.4% | PostScript 0.3% | Shell 0.3% | Makefile 0.1% | CMake 0.1%
🌐
PythonForBeginners
pythonforbeginners.com › home › how to use pillow, a fork of pil
How to use Pillow, a fork of PIL - PythonForBeginners.com
January 31, 2021 - To verify that Pillow is installed, open up a Terminal and type in the following line: $ python Python 2.7.5 (default, Aug 25 2013, 00:04:04) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from PIL import Image
🌐
GeeksforGeeks
geeksforgeeks.org › python-pillow-tutorial
Python Pillow Tutorial - GeeksforGeeks
June 16, 2024 - For displaying the image Pillow first converts the image to a .png format (on Windows OS) and stores it in a temporary buffer and then displays it. Therefore, due to the conversion of the image format to .png some properties of the original image file format might be lost (like animation). Therefore, it is advised to use this method only for test purposes. ... Refer to the below articles to get detailed information about opening and displaying images. ... from PIL import Image # Location of the image img = Image.open("geek.jpg") # size of the image print(img.size) # format of the image print(img.format)
🌐
Note.nkmk.me
note.nkmk.me › home › python › pillow
How to use Pillow (PIL: Python Imaging Library) | note.nkmk.me
May 14, 2019 - Draw circle, rectangle, line, etc. with Python, Pillow · First, create a solid image. Specify the size in the second argument and RGB colors in the third argument. from PIL import Image, ImageDraw, ImageFont im = Image.new("RGB", (512, 512), ...