'How can i use PIL in python?

I have successfully installed Pillow:

chris@MBPvonChristoph sources % python3 -m pip install --upgrade Pillow Collecting Pillow Using cached Pillow-9.0.1-1-cp310-cp310-macosx_11_0_arm64.whl (2.7 MB) Installing collected packages: Pillow Successfully installed Pillow-9.0.1

but when i try to use it in pycharm got:

Traceback (most recent call last): File "/Users/chris/PycharmProjects/pythonProject2/main.py", line 1, in from PIL import Image ModuleNotFoundError: No module named 'PIL'

or using in Blender i got:

ModuleNotFoundError: No module named 'PIL'

I am not a python lib installing pro...so obviously i made something wrong. But how do i fix that?

Maybe i have to say i am working on a M1 Macbook



Solution 1:[1]

first

pip uninstall PIL

after uninstall

python3 -m pip install --upgrade pip
python3 -m pip install --upgrade Pillow

or

brew install Pillow 

Sources

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

Source: Stack Overflow

Solution Source
Solution 1 ZeQ