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

3 Answers3

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
  • 7,332
  • 3
  • 48
  • 69
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
  • 9
  • 2
0

I have one version of python installed (python 3) and I had the same problem, but I tried their solution and it worked.

Juanmi Taboada
  • 539
  • 10
  • 25
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/33603448) – Antoine Jan 14 '23 at 07:59