1

Hello I've been trying to add an ImageField for one of my models in my Django app. When I ran the following code:

python3 manage.py makemigrations

A statement came out, saying I needed to install Pillow, which I did ('Successfully installed Pillow-8.2.0').

However, when I tried to run makemigrations again, the following error occurred:

(fields.E210) Cannot use ImageField because Pillow is not installed.
    HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".

I am aware that there are several threads out there that have discussed similar issues (like python/django - "Cannot use ImageField because Pillow is not installed") and I have tried doing whatever was recommended (reinstalling 64-bit Python, upgrading pip, making sure I don't have PIL, attempting to install an older Pillow version) but none worked.

Particularly, attempting to install an older Pillow version caused errors with the following message:

Pillow 7.1.0 does not support Python 3.9 and does not provide prebuilt Windows binaries.

I am using Windows 10, Python 3.9, Django 3.2.0 and Pillow 8.2.0 . Would really appreciate it if anyone can help me with this, thank you!

2 Answers2

1

first of all; there are some questions to be clear in order to provide input for it. Questions like; 1- Do you activated your virtualenv, 2- How did you check if Pillow installed correctly? ....... normally, activate virtualenv and then, run the command

pip freeze

this will list down all of installed packages.

zaman
  • 123
  • 1
  • 11
  • wait so am I supposed to install Pillow with my virtual environment activated or not? If I do so, then yes when 'pip freeze' is run, then Pillow==8.2.0 would be listed there as well. But when I run makemigrations, the same error occurs – confusion101 Jun 10 '21 at 06:51
  • yes. activate your virtualenv. env is the container like. that is inside is accessible. activate your env and run pip freeze. see if Pillow is listed. if not. run command ``` pip install Pillow``` – zaman Jun 10 '21 at 07:12
  • yes i already did that and Pillow is already listed, unfortunately when I run makemigrations again, the error is not fixed – confusion101 Jun 10 '21 at 08:11
  • could you provide all the code and errors. your model, and error. – zaman Jun 13 '21 at 06:42
-2

Just type

pip3 install pillow

Hope this works