Here is an easy code that works last year with my students. The goal is no show them some manipulations with images.
from os import system
system("pip install Pillow")
from PIL import Image
imageSource = Image.open("pomme.jpg")
r, v, b = imageSource.getpixel((100, 250))
print("Rouge :", r, "Vert :", v, "Bleu :", b)
It doesn’t work anymore! It seems there is a problem with PIL.
Here is the error message:
File "/home/runner/Manu-1/main.py", line 3, in <module>
from PIL import Image
ModuleNotFoundError: No module named 'PIL'
Welcome to the forums, @2deSNTpasteur!
Try running poetry add PIL in the shell. In Replit, pip doesn’t work, and also it is better to use the shell then to use os.system, so if you do this, please remove these lines of code:
Hi @2deSNTpasteur !
Can you go to poetry.lock and press CTRL+F to search and search in ‘pillow’?
If it’s not there, try doing poetry remove pillow then poetry add pillow or poetry add pillow.PIL if the previous command doesn’t work.