I'm using a Mac OS x 10.10.3 Yosemite, and Python 2.7.9 |Anaconda 2.2.0 (x86_64) for a lot of python stuff. I'm using eclipse, and google app engine.
I'm running out of stack overflow posts to read for this error that a lot of people have, then resolve by some means that has not work for me.
I'm getting this error:
import Image ImportError: No module named Image
From this code:
try:
from PIL import Image
except:
import Image
After I already tried the following:
conda install pillow
sudo pip install pillow
pip install pillow
pip install pil
Some stack overflow post suggested seeing if the path was there for another user, so I tried this in my terminal:
python
Python 2.7.9 |Anaconda 2.2.0 (x86_64)| (default, Dec 15 2014, 10:37:34)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
>>> import sys
>>> print(sys.path)
and got:
['',
'/Users/jrussek/anaconda/lib/python27.zip',
'/Users/jrussek/anaconda/lib/python2.7',
'/Users/jrussek/anaconda/lib/python2.7/plat-darwin',
'/Users/jrussek/anaconda/lib/python2.7/plat-mac',
'/Users/jrussek/anaconda/lib/python2.7/plat-mac/lib-scriptpackages',
'/Users/jrussek/anaconda/lib/python2.7/lib-tk',
'/Users/jrussek/anaconda/lib/python2.7/lib-old',
'/Users/jrussek/anaconda/lib/python2.7/lib-dynload',
'/Users/jrussek/anaconda/lib/python2.7/site-packages',
'/Users/jrussek/anaconda/lib/python2.7/site-packages/Sphinx-1.2.3 py2.7.egg',
'/Users/jrussek/anaconda/lib/python2.7/site-packages/aeosa',
'/Users/jrussek/anaconda/lib/python2.7/site-packages/cryptography-0.8-py2.7-macosx-10.5-x86_64.egg',
'/Users/jrussek/anaconda/lib/python2.7/site-packages/setuptools-14.3-py2.7.egg']
I thought it wasn't in my path so I tried to append the thing:
PYTHONPATH=/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL
didn't look like it showed up.
So I tried uninstalling, and reinstalling, in 10 different ways. I only did that for pillow, not PIL because I tried different things for PIL and looked at a lot of posts that said use pillow, not PIL because PIL is deprecated.
Anyway, for pillow I keep getting:
Requirement already up-to-date: pillow in ./anaconda/lib/python2.7/site-packages
clearly pillow is already installed in anaconda, but that doesn't help the import error I keep getting.
so then I tried conda install pillow,
and it upgraded some stuff:
but.. I try running my code again, and I still get no module found, no matter what import statement I try.
Suggestions? Please? Anyone?
conda search pil
? – physicalattractionFetching package metadata: .... pil 1.1.7 py27_0 defaults blah blah * 2.8.2 py27_0 defaults 2.8.2 py26_0 defaults
– user2738183