AnsweredAssumed Answered

Python: raster output to in-memory Error

Question asked by lnguyen@HNRG.COM_HFMNZ on Feb 25, 2020
Latest reply on Feb 25, 2020 by lnguyen@HNRG.COM_HFMNZ

Hi All,

I crossed a very headache issue.  The same code run successful in  ArcMap Python built-in Window

>>> arcpy.env.workspace = "\\in-memory"
>>> CurRas0 = Con(image,0,1,"Value = 0")


But I could not make it run from the Python IDLE, both IDLEs for 2.7.5 (ArcMap 10.2.2) and for 3.6.8 (ArcPro 2.3):

>>> arcpy.env.workspace = "\\in-memory"
>>> CurRas0 = Con(image,0,1,"Value = 0")
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
CurRas0 = Con(image,0,1,"Value = 0")
File "D:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\", line 271, in Con
File "D:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\", line 53, in swapper
result = wrapper(*args, **kwargs)
File "D:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\", line 265, in Wrapper
File "D:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\", line 506, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: ERROR 000875: Output raster: \in-memory\Con_Central_KIN1.tif's workspace is an invalid output workspace.
ERROR 000581: Invalid parameters.
Failed to execute (Con).

It keeps saying the workspace is invalid.


Anyone please shade me some lights on this? Thanks !