gpt4 book ai didi

python - DLL 加载失败 : %1 is not a valid Win32 application on Enthought

转载 作者:太空狗 更新时间:2023-10-30 01:37:05 25 4
gpt4 key购买 nike

我在 erdas 上尝试学习 Building Spatial Models in Python 时遇到了一个问题“ImportError: DLL load failed: %1 is not a valid Win32 application”文档。为此,我在 Pycharm 上使用 Enthought Canopy(64 位)。我想知道如何解决这个问题?我应该下载 Canopy 32 位版本,但我的电脑是 64 位的,顺便说一下。我的电脑上安装了 64 位版本的 ERDAS,我想知道是否 Erdas 32 位 version Imagine 模块可以解决这个问题吗?

这里是示例代码:

from exampleshelper import dataPath, outputPath
from imagine import modeler


m=modeler.Model()
ri = m.RasterInput(dataPath + "C:/Users/owrasa/PycharmProjects/den/data/lanier.img")
bandSelect = m.BandSelection(ri, "1:4")
sumBands = m.StackTotal(bandSelect)
ro = m.RasterOutput(sumBands, outputPath + "summing-image-layers.img")
m.Execute()

这里是整个错误信息:

C:\Users\owrasa\AppData\Local\Enthought\Canopy\User\Scripts\python.exe C:/Users/owrasa/PycharmProjects/den/layerstack.py
Using example data from C:/Users/owrasa/PycharmProjects/den\..\data\
and saving results in C:/Users/owrasa/PycharmProjects/den\..\output\
Traceback (most recent call last):
File "C:/Users/owrasa/PycharmProjects/den/layerstack.py", line 3, in <module>
from imagine import modeler
File "C:\Program Files\Intergraph\ERDAS IMAGINE 2014\usr\lib\Win32Release\python\imagine\__init__.py", line 19, in <module>
import init
File "C:\Program Files\Intergraph\ERDAS IMAGINE 2014\usr\lib\Win32Release\python\imagine\init\__init__.py", line 56, in <module>
_initToolkit();
File "C:\Program Files\Intergraph\ERDAS IMAGINE 2014\usr\lib\Win32Release\python\imagine\init\__init__.py", line 51, in _initToolkit
import _init
ImportError: DLL load failed: %1 is not a valid Win32 application.

Process finished with exit code 1

最佳答案

您正在尝试将 32 位 DLL 加载到 64 位应用程序中,这就是错误所在。将模块“转换”为 32 位的唯一方法是从源代码重新编译

关于python - DLL 加载失败 : %1 is not a valid Win32 application on Enthought,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41086707/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com