gpt4 book ai didi

python - Imagine 模块没有 modeler 属性

转载 作者:行者123 更新时间:2023-12-01 03:38:41 26 4
gpt4 key购买 nike

我正在尝试使用Python 进行layerstack 操作。但是,我陷入了错误。

这里是示例代码:

import os,sys
from imagine import modeler

m = modeler.Model()

# Import Bands 1-7
ri1 = m.RasterInput(path + “/” + folderName + “_B1.TIF”)
ri2 = m.RasterInput(path + “/” + folderName + “_B2.TIF”)
ri3 = m.RasterInput(path + “/” + folderName + “_B3.TIF”)
ri4 = m.RasterInput(path + “/” + folderName + “_B4.TIF”)
ri5 = m.RasterInput(path + “/” + folderName + “_B5.TIF”)
ri6 = m.RasterInput(path + “/” + folderName + “_B6.TIF”)
ri7 = m.RasterInput(path + “/” + folderName + “_B7.TIF”)

stackbands = m.StackLayers(ri1,ri2,ri3,ri4,ri5,ri6,ri7)
outputFile = path + “/” + folderName + “-msi.img”
ro = m.RasterOutput(stackbands, outputFile)
m.Execute()
print “\nCreating MS image using bands 1-7…”

我在from Imagine import modeler期间遇到错误,错误如下:

ImportError: cannot import name 'modeler'

我安装了 pip install Imagine 但在 Imagine 模块中没有 modeler 属性。我如何解决这个问题并且我使用 Python 3.5 和 Python 2.7我还下载了Python Scripting with ERDAS IMAGINE Spatial Modeler 2014,并且示例Python脚本由于缺少属性modeler而无法工作。我希望我能找到这个问题的答案。

最佳答案

确实,imagine has no member modeler 。但这是您从 PyPI 安装的模块。

如果你想做Python Scripting with ERDAS IMAGINE Spatial Modeler ,您应该尝试文档中所说的内容:

For reference, the ERDAS IMAGINE Python libraries are installed in: $IMAGINE_HOME\usr\lib\Win32Release\python

关于python - Imagine 模块没有 modeler 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40005575/

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