ImportError:DLL加载失败:%1不是_imaging模块的有效Win32应用程序

时间:2015-06-21 14:04:07

标签: python python-2.7 dll python-imaging-library

我正在尝试使用Python 2.7.9中的Gray Level Co-occurrence矩阵从图像中提取特征 我在其他答案中找到了下面给出的代码。当我运行此代码时,我得到:

  

ImportError:未安装_imaging C模块。

然后我安装了PIL模块,当我尝试导入其_imaging包时,它又出现了另一个错误:

  

ImportError:DLL加载失败:%1不是有效的Win32应用程序。

我已经在互联网上进行了很多研究但是没有给出真正的解决方案似乎有用,比如卸载PIL并安装PILLOW并检查python版本和模块的兼容性。

import skimage.io
import skimage.feature

im = skimage.io.imread('python.jpg', as_grey=True)

im = skimage.img_as_ubyte(im)
im /= 32

g = skimage.feature.greycomatrix(im, [1], [0], levels=8, symmetric=False, normed=True)

print skimage.feature.greycoprops(g, 'contrast')[0][0]
print skimage.feature.greycoprops(g, 'energy')[0][0]
print skimage.feature.greycoprops(g, 'homogeneity')[0][0]
print skimage.feature.greycoprops(g, 'correlation')[0][0]

1 个答案:

答案 0 :(得分:1)

通过从here

安装64位PILLOW模块Pillow-2.8.2-cp34-none-win_amd64.whl解决了这个问题