的另一个版本内置我得到的错误:PIL:导入错误:将_imaging扩展是为枕头或PIL
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-4-0f6709e38f49> in <module>()
----> 1 from PIL import Image
C:\Anaconda\lib\site-packages\PIL\Image.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
每当我尝试使用PIL库。我试图加载和一堆.gif注意的的工作,我尝试了,如下:
from PIL import Image
尝试了不同的方法,通过与SciPy的:
import scipy.ndimage as spnd
os.chdir('C:\\WeatherSink\\data\\')
spnd.imread('2014-11-03-0645.gif')
不符合:
---------------------------------------------------------------------------
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:\Anaconda\lib\site-packages\scipy\ndimage\io.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.
第一种方法指导我安装PIL版本。我尝试模拟getattr(...),并返回None。所以我并不感到惊讶,因为它不起作用。 但有谁知道如何'修复'的错误?
我在win7上运行,通过conda管理python2.7。我试图删除并重新安装这些软件包,而不会改变输出。
非常感谢帮助。
首先猜测你是否安装了多个版本的PIL或Pillow,并且可能在不同的环境下安装。找到他们全部,全部卸载它们,然后重新安装一个新的枕头。 – Hugo 2014-11-04 10:14:13