Can't use "memory" workspace in Python 3.6

522
4
Jump to solution
10-11-2019 06:35 AM
JakeJohnson
New Contributor II

I'm trying to speed up an automation script using memory workspaces. When I use "memory\feature_class", it returns that it can't use that workspace. However, "in_memory\feature_class" works exactly like I want.

I'm using Python 3.6 and ArcPro 2.4.2. My IDE recognizes the new format of ArcPy commands, as well. I don't know why it will only recognize the older memory workspace type.

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Esteemed Contributor

from

Write geoprocessing output to memory—ArcGIS Pro | ArcGIS Desktop 

Use of memory-based workspaces in a Python is only valid for geoprocessing tools. Memory is not a general-purpose virtual directory where you can write files or other data.

So that could be a limitation in your workflow

View solution in original post

4 Replies
JoshuaBixby
MVP Esteemed Contributor

Can you give an example of your use with a specific tool?

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

from

Write geoprocessing output to memory—ArcGIS Pro | ArcGIS Desktop 

Use of memory-based workspaces in a Python is only valid for geoprocessing tools. Memory is not a general-purpose virtual directory where you can write files or other data.

So that could be a limitation in your workflow

JakeJohnson
New Contributor II

Thanks, completely forgot about that limitation.

0 Kudos
alex_friant
Occasional Contributor II

Not even all gp tools work with memory workspaces. Like try to do it with arcpy.conversion.WFStoFeatureClass. Instead of writing it to memory\somefc, it writes it to disk as memory.gdb\somefc

0 Kudos