1

I just started a new Django project and when I try to makemigratons I get an error saying that I have to install Pillow and I have already installed Pillow.

ERRORS:
shop.ProductImages.product_img: (fields.E210) Cannot use ImageField because Pillow is not installed.
HINT: Get pillow at https://pypi.python.org/pypi/Pillow or run command "pip install pillow".

When I run pip freeze I can see that Pillow is already installed:

Pillow==2.7.0

I'm using Python 3.4.3 and Django 1.8. I didn't have this problem when I was using Python 2.7.

UPDATE:

When i try to import Image from PIL outside my virtualenv everything is fine, but when I try that in virtualenv i get this:

Traceback (most recent call last):
Fille "<stdin>", line 1, in <module>
File "C:\Python27\Lib\site-packages\PIL\Image.py", line 63, in <module>
from PIL import _imaging as core
ImportError: DLL load failed: The specified module could not be found.

I have python2 installed outside my virtualenv so does this mean that python is not looking in my virtualenv\Lib\site-packages? And I have just noticed that when I run pip freeze i get a list of packages that are installed on my system and not in virualenv, also when I try to install something that is already installed on my system I have to run pip --upgrade.

Ivan Pilipovic
  • 121
  • 1
  • 10
  • try upgrade pillow: `pip install -U pillow` – Cheng May 07 '15 at 03:57
  • Do you use virtualenv? Or you use the pre-installed Python? – Edwin Lunando May 07 '15 at 08:52
  • @Cheng Yes, I have tried pip install -U pillow, but it didn't help... – Ivan Pilipovic May 07 '15 at 10:33
  • @EdwinLunando Yes, I'm using virtualenv on Windows 8.1... – Ivan Pilipovic May 07 '15 at 10:36
  • try open up a python interpreter environment and enter `from PIL import Image` to see if the interpreter complains. Also, check out this post, it solved the same problem for a Mac machine, it might help you narrow down the issue: http://stackoverflow.com/questions/25662073/python-django-cannot-use-imagefield-because-pillow-is-not-installed – Cheng May 08 '15 at 03:17
  • It might have something to do with whether if your python3 is 32 bit or 64bit. Grab the right version of pillow too: https://pypi.python.org/pypi/Pillow/2.8.1 – Cheng May 08 '15 at 03:39
  • @Cheng I am runing 32 bit python3 on 32 bit operating system. I tried to import Image from PIL and i get ImportError. I have updated my question. – Ivan Pilipovic May 08 '15 at 14:32

2 Answers2

5

I overcome this problem with easy_install --upgrade pillow and if I want to install some package in virtualenv that I already have on my system I can just use pip <name of package> --upgrade. If someone have explanation for this problem and better solution please let me know!

Pikamander2
  • 5,875
  • 3
  • 42
  • 57
Ivan Pilipovic
  • 121
  • 1
  • 10
0

This happen because you have multiple python version installed. uninstall other python version and install pillow on your latest python version.

pujan rai
  • 11
  • 1