I get the error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-4-0f6709e38f49> in <module>()
----> 1 from PIL import Image
C:Anacondalibsite-packagesPILImage.py in <module>()
61 from PIL import _imaging as core
62 if PILLOW_VERSION != getattr(core, 'PILLOW_VERSION', None):
---> 63 raise ImportError("The _imaging extension was built for another "
64 " version of Pillow or PIL")
65
ImportError: The _imaging extension was built for another version of Pillow or PIL
Whenever I try to use the PIL library. I'm trying to load and work on a bunch of .gif's, and what I'm trying now, is the following:
from PIL import Image
Trying a different approach, through scipy with:
import scipy.ndimage as spnd
os.chdir('C:\WeatherSink\data\')
spnd.imread('2014-11-03-0645.gif')
Fails with:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-3-23c383b79646> in <module>()
1 os.chdir('C:\WeatherSink\data\')
----> 2 spnd.imread('2014-11-03-0645.gif')
C:Anacondalibsite-packagesscipy
dimageio.pyc in imread(fname, flatten, mode)
36 from PIL import Image
37 except ImportError:
---> 38 raise ImportError("Could not import the Python Imaging Library (PIL)"
39 " required to load image files. Please refer to"
40 " http://pypi.python.org/pypi/PIL/ for installation"
ImportError: Could not import the Python Imaging Library (PIL) required to load image files. Please refer to http://pypi.python.org/pypi/PIL/ for installation instructions.
The first approach guides me towards the versions of PIL installed. I try emulating the getattr(...), and that returns None. So I'm not surprised that it's less than functioning.
But does anyone know how to 'fix' the errors?
I'm running on win7, managing python2.7 through conda. I've tried to remove and re-install the packages as well, without any change in the output.
Help is much appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…