python – Why are the installation and import names different?

Question: Question:

About PIL.

When installing using pip

sudo pip install pillow

But when importing
import PIL

Why are pillow and PIL names different?

Answer: Answer:

Pillow is a fork of a library called PIL , so in this case Pillow 's import is the same as the original library's import . In other words, Pillow 's import is the same as PIL 's import because Pillow is a library that can be used as a replacement for PIL .

Also, PIL itself is not compatible with setuptools by nature, and it seems that the PIL development schedule was too late for some developers to properly fix bugs and problems, so PIL is finally a fork. It seems that it was done.

Scroll to Top