Problems access and installing PIL - python-2.7

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.

Related

Cannot install pillow on Windows

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

Cannot user easy_install or install pip

I am a noob here. Because I need to use Python 2.7 for work, I created another user login and tried to re-setup my dev environment. I have reinstalled python 2.7 using brew but I couldn't get easy_install or work and my system cannot find where pip is. Much frustration here, hope someone can help!
I have already tried to install pip and the system still cannot find it:

Pythonanywhere Pillow install not working

I have loaded my django app onto Pythonanywhere and when running through my functions, I learned I cannot upload images through the Admin since I moved into production. I am getting this error:
Neither Pillow nor PIL could be imported: No module named 'Image'
Which from prior experience means Pillow isn't installed. So I opened a bash console and ran
pip3 install --user Pillow
and it said it installed correctly, and I did reload my app but it still doesn't work
(same error). What went wrong?
Thanks in advance, Conner
Also, I did see this question on their forums: https://www.pythonanywhere.com/forums/topic/1247/
UPDATE:
Tried uninstalling Pillow and re-installing, then restarting web server. Still not working.

Why won't pip install anything?

Whenever I try to pip install anything in my virtualenvs I am told it is Downloading/Unpacking. My terminal then stays on that line indefinitely. The longest I have left this running was 2 hours (trying to install iPython) without success.
Most recently, I tried installing django in one virtualenv using pip. Once it said Downloading/Unpacking I created another virtualenv in another terminal window and used easy-install to install django and mezzanine. Both installed with their dependencies before there was any movement on the terminal using pip. I left the pip window running for an hour before giving up. I have tried pip install, pip install -v --use-mirrors and their sudo equivalents without much change in the results (-v --use-mirrors spews out a list of urls before stalling at Downloading/Unpacking).
I am using Python 2.7 on Ubuntu 12.04.1 64-bit. I use Virtuanlenvwrapper to create and manage my virtualenvs, if that helps.
I can't find any references to other people having this problem so I expect it's a mistake of mine. Does anyone have any idea what I'm doing wrong?
Following #HugoTavares's suggestion I found I needed to install python-dev. I don't know why this helped but it seems to have solved this particular problem. I'm putting this answer on for now but Hugo, if you read this, please post an identical one and I'll remove acceptance on this and accept yours, since you deserve the credit.

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