I was working on a new project and couldn't get the module to work. So, I went back and looked at something I knew worked, at one point. It doesn't work either...
Is PIL broken on repl.it?
Has python or PIL changed versions?
Has the syntax changed to need some other thing?
I even went to someone else's PIL example: https://repl.it/@dniemitalo/python-3-pillow-example
That is broken too...
Don't forget to install
- Click the weird 3d cube on the left side bar
- search for "Pillow"
- click the result that is "Pillow"
- click the install button
- now it should work!
You can always specify it in a
requirements.txt file, but I find UPM (the package thing) works better for repl.
The reason why repl isn't finding Pillow when you import "PIL" is that they don't have the same name: repl just looks for "PIL" on https://pypi.org then gives up. (though it seems PIL does exist? maybe repl removed autodetection?)