使用arcpy时,FNP preptool has not been run on this executable问题解决办法

在进行大规模流向分析时遇到 ArcGIS Pro 执行卡顿问题,尝试通过 PyCharm 运行官方代码,但出现 'FNPpreptoolhasnotbeenrunonthisexecutable' 错误。解决方法是获取并使用正版 ArcGIS Pro,安装后问题解决,能够成功运行流向分析。
摘要由CSDN通过智能技术生成

对FNP preptool has not been run on this executable解决办法:申请或购买正版

在使用arcgis pro进行流向分析时,因为区域面积太大,有大约1亿个栅格,运行过程总是卡在某个阶段,然后就一两天也不出结果,不知道是不是有bug。故尝试使用pycharm进行运行,官方代码如下:

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = r"工作空间"
outFlowDirection = FlowDirection("输入等参数")
outFlowDirection.save("输出")

关于代码的具体介绍可以参考帮助文档

运行的代码:

import arcpy
from arcpy import env
from arcpy.sa import *
with arcpy.EnvManager(scratchWorkspace=r"C:\test", workspace=r"C:\test"):
    out_flow_direction_raster = arcpy.sa.FlowDirection(r"C:\test\DEM_Fill.tif", "NORMAL", None, "D8")
    out_flow_direction_raster.save(r"C:\test\flowdir.tif")

在此遇到了问题:

FNP preptool has not been run on this executable

在这里插入图片描述
针对这个问题找了好久,没有解决办法,后来打开pycharm的编译器,也是arcgis pro的编译器
在这里插入图片描述
后来申请并下载了arcgis pro的试用版,再打开时,就不会提示:FNP preptool has not been run on this executable

所以解决办法就是申请正版

并且使用正版,流向分析跑出来结果了

评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值