l run into an problem "ImportError: DLL load failed: %1 is not a valid Win32 application"
when l try to learn Building Spatial Models in Python
on erdas document. For this , l m using Enthought Canopy (64-bit)
on Pycharm
.l would like to know how l can solve this problem? should l download Canopy 32 bit version but my pc is 64 bit, by the way.l have 64 bit version of ERDAS
installed on my pc and l wonder whether Erdas 32 bit
version Imagine
module could solve this problem?
here is example 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 whole 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