Cannot install pillow on Windows - python-2.7

I keep getting errors when I try to run pillow on x64 Windows
I have followed these instructions for installing pillow
I seem to able to
import PIL
but it fails when I try
from PIL import image
See screen shot
Can someone please help?
I've tried installing the 32 bit version, but that fails and trying to uninstall pillow also fails

Solved
All I needed to do was
pip install pillow
That simple

Related

Problems access and installing PIL

I have used the PIL library for image manipulation for over 2 years without any mishaps. Suddenly a few days ago it started acting up on me. So I followed advice from this forum by uninstalling PIL and trying to reinstall it only to met with a message that no matching distribution was found for PIL.
Please Help!!
pip install pillow
You uninstalled Pillow successfully, so install it again like this.

installing pygame over anaconda

I am trying to install pygame over anaconda. My OS is windows 7 64 bit and I downloaded the following files:
pygame-1.9.2a0-cp27-none-win32.whl
pygame-1.9.2a0-cp27-none-win_amd64.whl
prebuilt-x64-pygame-1.9.2-20150907.zip
pygame-1.9.2a0-hg_ea3b3bb8714a.win32-py2.7.msi
pygame-1.9.2a0.win32-py2.7.msi
I get this error after "pip install pygame":
Could not find a version that satisfies the requirement pygame (from versions: ) Some externally hosted files were ignored as access to them may be unreliable (use --allow-external
What am I missing?
Thanks
This worked for me when installing pygame with anaconda. I believe that if you go into the terminal on anaconda and type
Pip install pygame
It installs the latest version of pygame into your environment

Kivy cannot find PIL module in Mac

OSX 10.10.2, Python 2.7.9, Kivy 1.9
I used sudo pip install Pillow to install Pillow when i get the not found error. I can find PIL in python help('modules') but not in kivy help('modules')
I tried Kivy user group but got no reply yet. Thank you in advance!
Kivy 1.9 package uses it's own Virtual Environment. You have to make sure to install modules into that. Simply do::
kivy -m pip install pillow
Probably kivy is looking for the Pillow package in the wrong place.
You should check where your library is installed and use that path.
The path should be something like "/Library/Python/2.7/site-packages/", look if you have the PIL package in that position.
Then set the PYTHONPATH variable or use
import sys
sys.path.append('path_to_the_PILLOW_package')
and look if "import PIL" raises an ImportError.

IOError decoder zip not available

I'm trying to get up and running with sorl thumbnail but I'm getting an error "decoder zip not available".
I have read through a ton of similar pages saying that it is a PIL / Pilow issue.
I have tried re-installing pil via:
easy_install http://dist.plone.org/thirdparty/PIL-1.1.7.tar.gz
As well as:
pip uninstall PIL Pillow
pip install Pillow
pip install PIL
I read that Ubuntu uses a directory called /lib/x86_64-linux-gnu for x64 architectures. If you are using that architecture you need to create a symbolic link for that as well as for other shared libraries.
$ sudo ln -s /lib/x86_64-linux-gnu/libz.so.1 /lib/libz.so
Additional info:
OS: Ubuntu Precice
I have not tried installing the package zlib from source which some others have also mentioned worked for them.
I found two solutions for this that worked for me.
The first way that worked for me was to use a different imaging library all together. I installed pgmagic and that worked fine.
sudo apt-get install libgraphicsmagick++-dev
sudo apt-get install libboost-python1.40-dev
There is also other imaging libraries available and they are all listed in the sorl-thumbnail docs:
http://sorl-thumbnail.readthedocs.org/en/latest/requirements.html
The second way that worked for me (preferred) was literally a fresh install of everything where I removed both pillow and PIL and the re-installed them starting with pillow.
pip uninstall pillow
pip uninstall PIL
pip install pillow
pip install PIL

Uploading a JPEG image via Django displays error

I'm running a Django app inside a virtualenv on Ubuntu with NGINX/FastCGI and trying to upload a JPG image to the Django admin app.
I'm getting this error: "Upload a valid image. The file you uploaded was either not an image or a corrupted image." I can upload a GIF image, so it's only JPEG that's causing the problem.
Here's what I've tried so far:
1) Install libjpeg62-dev before PIL
pip uninstall pil
sudo apt-get libjpeg62-dev
pip install pil
At the end of the PIL install, I see:
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform linux2 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3]
--------------------------------------------------------------------
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
So it looks like JPEG support is there. I've also done the manual test to verify and it verified:
>>> from PIL import Image
>>> trial_image=Image.open("/path/to/my/image.png")
>>> trial_image.verify()
2) Similar to approach #1 above, but manually specifying the JPG_ROOT:
pip uninstall pil
sudo apt-get libjpeg62-dev
pip install --no-install pil
vi /path/to/virtualenv/build/PIL/setup.py (JPG_ROOT = libinclude("/usr/lib"))
pip install pil
3) Try my luck with Pillow (a PIL fork)
pip uninstall pil
sudo apt-get libjpeg62-dev
pip install pillow
I'm running Django under I've also trying stopping & starting the nginx service after each time installing PIL.
So far none of the above approaches have gotten me past the above error message in my Django app on Ubuntu. I can upload the same JPG image just fine on my local dev box (Mac OSX 10.6.5) running the same Django app, so I know it's something with my deployment on Ubuntu.
Any help would be appreciated!
Well what do you know, I decided to log out of the Django admin and log back in....suddenly it works fine! Sheesh. The last thing I tried was approach #2 above so if anyone is having this problem, that's your best solution.
You were close. But the library required was different.
The answer, helped me, is here https://stackoverflow.com/a/23445746/1478569