Reputation: 11
After upgrading Python 3.8 to 3.9 this error has happened and says pillow is not installed. I tried to uninstall and reinstall pillow, but it did not worked.
I'm using Django 3.1 on a Windows 10 pro.
The output of pip freeze
is attached too.
Here is the error message:
ERRORS:
magazine.Magazine.image: (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".
post.Posts.image: (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".
post.Sample.image: (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".
post.Workers.avatar: (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".
product.Products.image: (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".
Upvotes: 0
Views: 1342
Reputation: 395
Make sure you don't have any Pillow or PIL folder (older version) in your main project directory, as this will cause conflicts if you have Pillow installed in a virtual environment or in the PythonXX folder.
If you are using the virtual environment, you will need to re-install pillow. But do not run "pip uninstall Pillow" before you activate the virtual environment.
Remove any older versions of Pillow if you had manually put them in your project folder. Activate the virtual environment, then uninstall, and then install it again.
env/Scripts/activate.ps1
pip uninstall Pillow
python -m pip install Pillow
Upvotes: 0
Reputation: 871
It's warning because old version of pip was renaming folders that it could not delete, replacing first letter with tilda ~.
In your C:\..\python38-32\lib\site-packages
have a folder named ~illow...
.
When I delete that folder and reinstall python -m pip Pillow
, it's worked.
I have same error and this post solved problem.
Upvotes: 2
Reputation: 177
1.Activate the virtual environment (your env path).\Scripts\activate 2.Run the Django application
This will work.
Upvotes: 0