Monday, August 27, 2012

Upload a valid image. The file you uploaded was either not an image or a corrupted image.

With virtualenv, PIL doesn't work. Whenever you try to upload an image it says:
"Upload a valid image. The file you uploaded was either not an image or a corrupted image."
 
To over come this, just do these in your venv:
pip uninstall pil
pip install pillow


 I saw this solution from here but it's got a typo. You have to remove pil, not virtualenv.

No comments: