【问题标题】:ImportError: DLL load failed: %1 is not a valid Win32 application for _imaging moduleImportError:DLL 加载失败:%1 不是 _imaging 模块的有效 Win32 应用程序
【发布时间】:2015-09-07 01:02:49
【问题描述】:

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

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]

【问题讨论】:

  • 我的猜测是,您将 64 位 python 解释器与 32 位 python 模块混合在一起。
  • 谢谢@Sneftel。我得到了错误的模块。现在,当我安装了一个新的时,它可以工作了。
  • 你们中的一个人可以发布一个答案以表明问题已解决。

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


【解决方案1】:

问题已通过从here 安装 64 位 PILLOW 模块 Pillow‑2.8.2‑cp34‑none‑win_amd64.whl 解决

【讨论】:

    猜你喜欢
    • 2013-11-09
    • 2016-02-01
    • 2014-01-28
    • 2020-08-22
    • 2013-09-24
    • 2014-12-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多