Skip to content
← Back to Community
PIL module not found
Profile icon
WilliamBeshoar

Here's a link to the code. Its saying that PIL is not defined.

https://repl.it/@WilliamBeshoar/Python-3

https://repl.it/@NaomiLee/SquigglyAuthenticRadius

Heres both of the links to the code. there both not working.

Voters
Profile icon
Darquenn
Profile icon
davidchancerel
Profile icon
shishir3xrd
Profile icon
KeiraLeveneur
Profile icon
WilliamBeshoar
Comments
hotnewtop
Profile icon
Ian-Codes

Go into the shell and type pip install Pillow

Profile icon
ArjunSS1

Geocube’s way is very good but a better way to do this would be to add a requirements.txt file into your code and in the file writing PIL. Repl automatically imports all modules in the requirements.txt file before executing the main script.

Profile icon
Geocube101

Try either importing from the package manager or adding...

from os import system system('pip install Pillow')

...to the beginning of your code

Profile icon
Sandy84

Thanks to Ian-Codes, it works now ! no more message saying that PIL is not defined.