The single line that I am trying to run is the following:
from PIL import Image
However simple this may seem, it gives an error:
All the answers were great however what did it for me was a combination of uninstalling Pillow
pip uninstall Pillow
Then installing whatever packages you need e.g.
sudo apt-get -y install python-imaging
sudo apt-get -y install zlib1g-dev
sudo apt-get -y install libjpeg-dev
And then using easy_install to reinstall Pillow
easy_install Pillow
Hope this helps others
I had the same issue, and did this to fix it:
In command prompt
pip install Pillow ##
Ensure that you use
from PIL import Image
I
in Image
has to be capital. That was the issue in my case.
had the same error while using pytorch code which had deprecated pillow code. since PILLOW_VERSION was deprecated, i worked around it by:
Simply duplicating the _version file and renaming it as PILLOW_VERSION.py in the same folder.
worked for me
I had the same error. Here was my workflow. I first installed PIL (not Pillow) using
pip install --no-index -f https://dist.plone.org/thirdparty/ -U PIL
Then I found Pillow and installed it using
pip install Pillow
What fixed my issues was uninstalling both and reinstalling Pillow
pip uninstall PIL
pip uninstall Pillow
pip install Pillow
Now, I actually did some debugging with my brother and found that Pillow (PIL) needed to be initialized. I don't know how to initialize it, so you could probably stick with reinstalling Pillow.
FWIW, the following worked for me when I had this same error:
pip install --upgrade --force-reinstall pillow