7๐
I tried :
- Reinstall globaly PIL by compiling โImaging-1.1.7โ using some instructions here, but didnโt work
- Reinstall Pillow and itโs dependency globally using that link, but didnโt work
- Reinstall GCC4.2 using this link, but it didnโt work
I finally figured out I was in the case described in the wonderfull answer to this post. In other words, I am running a mac whose CPU is capable of 64bit but whose kernel firmware is set to 32bit. Which is a problem as the project Iโm working on was built for 64bit.
As explained in that post, when you install python3 using an installer (DMG) it will sniff if the kernel is set to 32 bit and install 32bit version of python 3 accordingly. But if you just download the tarball source from pythonโs website and install it with :
cd Python-3.4.1
./configure
make
sudo make install
Then the 64bit version of python3 should be installed. Which you can verify by doing :
file /usr/local/bin/python3
/usr/local/bin/python3: Mach-O 64-bit executable x86_64
That done, all problems are gone with PIL/Pillow in the virtualenv using this 64bit version of python3. Even the pip downgrade became unnecessary.
37๐
I was having this problem on a Mac with Python 3.6.4. The solution was to uninstall Pillow 5.1.0 and instead install 5.0.0.
pip uninstall Pillow
pip install Pillow==5.0.0
- [Django]-How to write a Pandas DataFrame to Django model
- [Django]-Django order_by() filter with distinct()
- [Django]-Django's ManyToMany Relationship with Additional Fields
5๐
I was too getting same problem while implememnting Image Upload using CLoudinary , but found the Above answer, but in some other way.
sudo pip uninstall PIL
sudo pip uninstall Pillow
sudo pip install Pillow
After that mine Problem was solved !
- [Django]-Automated django receive hook on server: respond to collectstatic with "yes"
- [Django]-Why do we need to use rabbitmq
- [Django]-Self.instance in Django ModelForm
4๐
For those who faced this issue with alpine-based image in docker;
Pillow requires these os level modules(for installation)
gcc
musl-dev
jpeg-dev
zlib-dev
libjpeg
You probably delete these modules after install your python packages but, for use Pillow without issue, it requires libjpeg
Unless, Django raise with error:
Cannot use ImageField because Pillow is not installed.
So add this module in Dockerfile(or donโt uninstall):
RUN apk add libjpeg
works for me
- [Django]-How to get full url from django request
- [Django]-How do I generate a static html file from a django template?
- [Django]-How can I list urlpatterns (endpoints) on Django?
2๐
Had a similar problem, and my solution was much simpler:
Apparently packages PIL and Pillow canโt coexist. If you want to use Pillow you first have to uninstall PIL and then install Pillow.
If you are on Mac, you have to install a few libraries as well using brew. Mentioned below is the sequence of steps:
$pip uninstall PIL
$brew install libtiff libjpeg webp little-cms2
$pip install Pillow
To test if pillow is installed and ready to use, open python interpreter and try to import the following:
>>> from PIL import Image
*note that the library still says PIL but now it is importing from Pillow instead of PIL.
If you are able to successfully import then you are good to go (in all probability you wonโt have to worry about setting PYTHONPATH or 32/64-bit installations)
Source: https://pillow.readthedocs.io/en/latest/installation.html
- [Django]-Django admin: override delete method
- [Django]-How can I use redis with Django?
- [Django]-Django and fieldsets on ModelForm
2๐
macOS High Sierra 10.13.6
My solution was
pip3 install Pillow
Not
pip install Pillow
- [Django]-Django โ show the length of a queryset in a template
- [Django]-How to move a model between two Django apps (Django 1.7)
- [Django]-Django and Restful APIs
2๐
I do not know why, but uninstalling and then reinstalling Pillow (same version) solved this problem for me.
python -m pip uninstall Pillow
python -m pip install Pillow
The Pillow version was 7.1.1.
- [Django]-Django filter many-to-many with contains
- [Django]-_() or {% trans %} in Django templates?
- [Django]-Restrict django FloatField to 2 decimal places
2๐
For some reason,
pip install pillow
wasnt working.
so I went to the official site of pillow and used
python -m pip install --upgrade pillow
which solved my issue of installing pillow.
- [Django]-Django: Admin: changing the widget of the field in Admin
- [Django]-Aggregation of an annotation in GROUP BY in Django
- [Django]-Can I Make a foreignKey to same model in django?
2๐
I was able to solve mine by going to this link in the docs:
https://pillow.readthedocs.io/en/latest/installation.html
Answer: PILLOW VERSION WILL NOT WORK IN A PYTHON VERSION IT WAS NOT MADE FOR!
So I had to check the chart. I was running django on python==3.9.13, so I needed to uninstall the pillow==7.2.0 to Install pillow==8.3.1 for my python version 3.9.13 and Boom it started working.
I did this:
pip uninstall Pillow
pip install Pillow==8.3.1
OR
python -m pip uninstall Pillow
python -m pip install Pillow==8.3.1
So it all depends on the python version you are running pillow on.
- [Django]-Django: When extending User, better to use OneToOneField(User) or ForeignKey(User, unique=True)?
- [Django]-Django Rest Framework custom response message
- [Django]-Django-rest-framework 3.0 create or update in nested serializer
1๐
I had this error using PyCharmโs debugger. I had to go to Settings->โProject Interpreterโ highlight โPillowโ and hit the little up arrow on the right to upgrade it. Then the error disappeared.
- [Django]-Temporarily disable auto_now / auto_now_add
- [Django]-Get objects from a many to many field
- [Django]-Different databases for different apps in Django
1๐
In your โsite-packagesโ file, download your desired pillow (.whl) file, then install it using command, โpip install "directory"โ.
I have seen that this error occurs due to wrong version of pillow, in term of bit installation in my case.
If you have 32 bit machine then you have to download 32 bit Pillow.
If you have 64 bit machine then you have to download 64 bit Pillow.
In my case I was using Visual Studio but when I tried to install Pillow using PyCharm then it downloaded and installed suitable Pillow version automatically which work was not being done by Visual Studio automatically.
Visual Studio was installing Pillow wrong version again and again many times when I was trying to install Pillow by uninstalling.
Basically it was fetching .whl file from cache file I guess.
- [Django]-Django test runner not finding tests
- [Django]-Django. TemplateDoesNotExist in case of a custom widget
- [Django]-Django templates folders
0๐
For python3 make sure your $PYTHONPATH
has the virtualenv
path and
Instead of running the command
python manage.py migrate
Run:
python3 manage.py migrate
- [Django]-Django forms: "This field is required" when file POSTed to file field
- [Django]-Django abstract models versus regular inheritance
- [Django]-Add Serializer on Reverse Relationship โ Django Rest Framework
0๐
If you are using Pillow 4.1.0 with Python 3.6.0 then upgrading the Python version will fix this issue.
Found the solution here: https://github.com/python-pillow/Pillow/issues/2479#issuecomment-292252147
- [Django]-Django Setup Default Logging
- [Django]-How to reset migrations in Django 1.7
- [Django]-Any thoughts on A/B testing in Django based project?
0๐
I had the same problem in my virtual environment, even though Pillow was installed. Also installing a lower version didnโt help. As soon I left my virtual environment it worked. Maybe this is helping someone.
There is the command:
(wb_env) C:\Users\Taranis\Dropbox\08_Coding\Python
Coding\Programme\Projekt_Webblog\tim_webblog>python manage.py makemigrations app_webblog
The error:
SystemCheckError: System check identified some issues:
ERRORS:
app_webblog.BlogEntry.entry_img: (fields.E210) Cannot use ImageField because
Pillow is not installed.
HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "pip install
Pillow".
- [Django]-Django โ update model with FormView and ModelForm
- [Django]-How do I print out the contents of my settings in a django shell?
- [Django]-How to save a model without sending a signal?
0๐
What worked for me was to uninstall Pillow from user folder and install it with sudo
.
Initial install was:
$ pip3 install Pillow --user
installed to: ~/.local/lib/python3.7/site-packages/Pillow-7.0.0.dist-info
So first uninstalled it and then installed with sudo
:
$ pip3 uninstall Pillow
$ sudo pip3 install Pillow
new location: /usr/local/lib64/python3.7/site-packages/Pillow-7.0.0.dist-info
and problem was fixed.
- [Django]-Django serving robots.txt efficiently
- [Django]-Django: Insert row into database
- [Django]-Django Rest Framework writable nested serializers
0๐
Window users
First Uninstall Pip
pip uninstall Pillow
Then Install it Again
pip install Pillow
Ubuntu users
First Uninstall Pip
sudo pip uninstall Pillow
Then Install it Again
sudo pip install Pillow
I Hope It will works for you
- [Django]-Get first item of QuerySet in template
- [Django]-Manually create a Django QuerySet or rather manually add objects to a QuerySet
- [Django]-How to hide some fields in django-admin?
0๐
This is what worked for me,
sudo apt-get install libjpeg-dev -y
sudo apt-get install zlib1g-dev -y
sudo apt-get install libfreetype6-dev -y
sudo apt-get install liblcms1-dev -y
sudo apt-get install libopenjp2-7 -y
sudo apt-get install libtiff5 -y
You probably have some of them installed but not all. For me, some of them werenโt and that was causing the issue.
- [Django]-Django "login() takes exactly 1 argument (2 given)" error
- [Django]-Resize fields in Django Admin
- [Django]-Indexing JSONField in Django PostgreSQL
0๐
You might get ModuleNotFoundError: No module named โpillowโ
This could be because you added it to your installed_apps in settings.py
To solve this:
Just remove it from installed_apps or change it to "PIL"
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# installed apps
'pillow',
]
to this:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# installed apps
'PIL',
]
If you just comment it out,
# 'pillow'
you will still get ModuleNotFoundError: No module named โpillowโ
so make sure you delete it completely.
- [Django]-What is pip install -q -e . for in this Travis-CI build tutorial?
- [Django]-Get request data in Django form
- [Django]-Django: Why do some model fields clash with each other?
0๐
If you are coding on a raspberry with a lite os, this fixed my bug :
sudo apt-get install libopenjp2-7-dev
Good Luck ๐
- [Django]-Django error message "Add a related_name argument to the definition"
- [Django]-Django not sending emails to admins
- [Django]-How to check Django version
0๐
Got similar issue, I was running django in a virtual environment.
pip install Pillow
command installed Pillow but django was not recognising it.
This solved the issue for me:
python3 -m pip install Pillow
Initially I got issue when I tried running the pip command using python -m
but then I installed pip using python3
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py --force-reinstall
and then ran python3 -m pip install Pillow
- [Django]-Django.core.exceptions.ImproperlyConfigured: Requested setting LOGGING_CONFIG, but settings are not configured
- [Django]-Django Sitemaps and "normal" views
- [Django]-Paginate relationship in Django REST Framework?
- [Django]-Migrating ManyToManyField to null true, blank true, isn't recognized
- [Django]-How to add token auth to swagger + django rest framework?
- [Django]-Bypass confirmation prompt for pip uninstall
0๐
you just install pillow in your (venv) not in your main python path. you have to use poweshell or commandline of pycharm (for example).
- [Django]-Tailwindcss: fixed/sticky footer on the bottom
- [Django]-How to test custom template tags in Django?
- [Django]-TypeError: data.forEach is not a function
- [Django]-Get router url name when testing in Django Rest Framework
- [Django]-Python/Django: log to console under runserver, log to file under Apache
- [Django]-How to add custom field in ModelSerializer?
0๐
If you have installed Pillow but the error is persisting , This will solve the problem
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade Pillow
- [Django]-Django update queryset with annotation
- [Django]-__init__() got an unexpected keyword argument 'mimetype'
- [Django]-Requirements.txt greater than equal to and then less than?
- [Django]-How can I exclude South migrations from coverage reports using coverage.py
- [Django]-Displaying a Table in Django from Database
- [Django]-Django filter events occurring today