Is there any way to fix python thinking PIL doesnt exist? I found another post that solved the issue by forking an older replit but every time I open the replit, it just auto updates to the newest version and stops working.
It just says it cannot find PIL library
It… says PIL exists
main.py - name here - Replit
from PIL import Image, ImageDraw, ImageFont, ImageColor
I’m having the same issue with matplotlib.pyplot. Now whenever I open any of my replits it auto updates and stops working…
Can you try running
curl https://pythonify.util.repl.co/recreate_python3_venv.sh | bash in the shell of your Repl to create a new python virtual environment?
I had the same issue, manually installing Pillow with
pip install pillow should fix your issue.
It happens because replits auto import feature tries to find a package named
PIL when it is actually named
To fix this, we will disable this for that repl.
.replit file and change the
guessImports = true to
guessImports = false
Go to shell and do
poetry add pillow
Run your code. It should work.
Note: after doing this, you need to add all new packages manually using poetry in the same manner:
poetry add <package name>
May 29, 2023, 10:21pm
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.