I am a flask newbie. I want to use PIL module in flask. However after writing my code, when I try to start my server, I get an error that ImportError: No module named PIL
. What is wrong here?
Asked
Active
Viewed 2,214 times
1

Bun
- 3,037
- 3
- 19
- 29

Vivek Sasidharan
- 1,265
- 3
- 17
- 34
-
Do you have PIL or Pillow installed? Check http://stackoverflow.com/questions/6579995/django-no-module-named-pil – Krzusztof Jul 13 '15 at 14:48
-
Yup I have it installed on my machine and importable via python interpreter – Vivek Sasidharan Jul 13 '15 at 14:49
1 Answers
5

Bun
- 3,037
- 3
- 19
- 29
-
I already have it installed in my machine. Accessible using python interpreter. Or am I missing something here – Vivek Sasidharan Jul 13 '15 at 14:52
-
Do you use virtual environment? How do you use PIL in your project? Note: Pillow >= 2.1.0 no longer supports “import _imaging”. Please use “from PIL.Image import core as _imaging” instead. – Bun Jul 13 '15 at 14:54
-
yes i use virtual environment. But wait, do I need to install PIL inside flask also? – Vivek Sasidharan Jul 13 '15 at 14:56
-
-
1Go to your virtualenv, then type `pip freeze` to see whether PIL or PILLow exist. If not, install it. – Bun Jul 13 '15 at 14:57
-