python - 导入错误: DLL load failed: %1 is not a valid Win32 application for _imaging module

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

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

ImportError: The _imaging C module is not installed.

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

ImportError: DLL load failed: %1 is not a valid Win32 application.

我已经在互联网上进行了很多研究,但似乎没有给出真正有效的解决方案,例如卸载 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]

最佳答案

通过安装 here 中的 64 位 PILLOW 模块 Pillow‑2.8.2‑cp34‑none‑win_amd64.whl 解决了该问题

关于python - 导入错误: DLL load failed: %1 is not a valid Win32 application for _imaging module,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30965365/

相关文章:

python - pywin32 excel查找工作簿中有多少张工作表并按数字索引?

python - 从类方法调用实例方法,在python3中允许,在python2中不允许?

c++ - 如何在创建 DLL 时禁用 VC++ 中的语言扩展?

python - 使用 ctypes 调用指向定义为静态的函数的函数指针

python - 获取中位数两侧的两个数字

python - MongoDB 的位置索引在什么单位?米?英里?

python - 以变​​量作为列名的 Pandas 查询

python - 在 Pandas 中读取、选择和重新排列列

python - 类型提示 lambda 函数作为函数参数

c++ - 构建 Windows dll 的建议