The ArcGIS for Desktop "ERROR 000210: Cannot create output" has been reported on this site a number of times but an in_memory workspace seems to have been implicated only once:
ERROR 000210: Cannot create output in_memory
which was in Getting 000210 Error trying to wirte output to in_memory workspace in ModelBuilder?
I have just encountered the same error message from ArcPy, using ArcGIS 10.2.2 for Desktop both in a Python script tool and from IDLE.
I have determined the cause and so I am asking a question in order to provide an answer to anyone who may encounter it in future.
What causes the error message below from ArcPy?
ExecuteError: ERROR 000210: Cannot create output in_memory\AND
Failed to execute (CopyFeatures)
Best Answer
Not wishing to detract from PolyGeo's excellent answer I wanted to know what other words can't be used for creating feature classes. To this end I wrote a simple script in python to try every alphanumeric combination and found some interesting results:
At the risk of putting the 'horse before the cart' I think it's worthwhile to review the results before disclosing the code:
It is interesting that feature classes can be created with 'bad' names using CreateFeatureClass but when using CopyFeatures certain names are not allowed; also, interestingly, names can start with underscores - perhaps then we should be prepending with underscore (for example:
"in_memory\\_" + name
) to 'sanitise' names before using.The code:
The code incrementally tries every character combination (lower then upper) and logs the name when the operation fails; it will take a long time to run but in the end every plausible combination from one to seven characters will be tried. Note: I have not included punctuation or non-keyboard characters. Other language sets may have different words that are bad, based on the findings the bad words are SQL keywords and they're all English (aren't they?).