l encounters the problem "ImportError: DLL load failed: %1 is not a valid Win32 application" when I try to learn Building Spatial Models in Python in an erdas document. To do this, lm using Enthought Canopy (64-bit) on Pycharm .l would like to know how I can solve this problem? should download a 32-bit version of Canopy, but my computer is 64-bit, by the way. I have 64 bit version of ERDAS installed on my computer, and it is not surprising that the Erdas 32 bit version Imagine module Erdas 32 bit solve this problem?
here is a sample code:
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()
here is the complete error message:
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
source share