'Python can't import installed libraries

Downloaded Pillow using python -m pip install pillow from cmd. Using python -m pip list I checked whether it installed. When I try to import it in program like from PIL import Image I get a "no module named PIL" error. I tried a couple of methods like reinstalling the lib and tried different libraries. They were shown as installed, but when using them I got the same error as before. I only have Python 3.10 on my Windows 10 PC. What is the problem?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source