I solved this problem by back tracking.In case other people stumble on this post while searching for their own solution here is what happened:The 'in_layer' that I was using ('in_memery\\mergedStreetsPolygons') was not actually a layer, it was an in_memory feature class.It originated from this command which I thought would output as a layer:arcpy.FeatureToPolygon_management('in_memory\\mergedStreets', 'in_memory\\mergedStreetsPolygons', "", "ATTRIBUTES", "")
I tried to modify the command to force it to output as a layer and that did not work, I guess it is only able to output to Feature Class:>>> arcpy.SelectLayerByLocation_management('in_memory\\mergedStreetsPolygons', "COMPLETELY_WITHIN", 'in_memory\\mtdbStreetBuffer.lyr', "", "NEW_SELECTION") Traceback (most recent call last): File "<pyshell#23>", line 1, in <module> arcpy.SelectLayerByLocation_management('in_memory\\mergedStreetsPolygons', "COMPLETELY_WITHIN", 'in_memory\\mtdbStreetBuffer.lyr', "", "NEW_SELECTION") File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\management.py", line 6559, in SelectLayerByLocation raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000368: Invalid input data. ERROR 000732: Selecting Features: Dataset in_memory\mtdbStreetBuffer.lyr does not exist or is not supported Failed to execute (SelectLayerByLocation).
So I just added a line to convert it to a Layer and used the new layer name for the in_layer parameter. It worked:>>> arcpy.MakeFeatureLayer_management('in_memory\\mergedStreetsPolygons', 'in_memory\\mergedStreetsPolygons.lyr') <Result 'in_memory\\mergedStreetsPolygons.lyr'> >>> arcpy.SelectLayerByLocation_management('in_memory\\mergedStreetsPolygons.lyr', "COMPLETELY_WITHIN", 'in_memory\\mtdbStreetBuffer', "", "NEW_SELECTION") <Result 'in_memory\\mergedStreetsPolygons.lyr'>
Of course the on disk copies that I made (for trouble shooting) worked okay in ArcMap because when I brought them into the map it made layers of them.Just a quick reminder, if you do something like this to fix your code make sure that all future commands that referenced the old 'layer' [technically it wasn't a layer, hence the error message] get updated to use the new one...