I'm working in 10.2.2 and running this stand alone in Idle.
The script is very simple:
The feature class is just fine and works in ArcMap. I even created a new mdb and new FC to make sure that it is the right version.
It works ok with gdb feature classes, but when I point it at an mdb as above it gives me:
ERROR 000732: Input Features: Dataset D:/SWB/SWB_grid_builder_eq_area2.mdb/precip_sites_yr does not exist or is not supportedFailed to execute (MakeFeatureLayer).
Anybody know what is going on?
Did you try running the Make Feature Layer through the geoprocessing tool dialog in arcmap? If that fails then this article from Esri may be relevant.
Since your feature class appears to be working normally everywhere but within the geoprocessing environment, it may be a question of an invalid subtype, an issue with on-the-fly projection (is your data frame in an XY coordinate system that matches the feature class from which you want to make a feature layer?), or maybe turning off background geoprocessing.
Hopefully one of these will work for you!
This function should work on a personal geodatabase feature class. Have you tried any other MDBs? I would recommend creating another, import a feature class and see if this is reproducible.
I have a gdb in the same folder. In AcCatalog I copied the feature class into it. I changed the code to point at it in the gdb instead of the mdb:
And it runs without a problem.
I am only running it as a stand-alone script, saved as a python script, and executing it from Idle python editor. I need to do this to do other analyses outside of ArcMap. The full error message for the mdb printed above is below.
Traceback (most recent call last):
File "D:/code/python/layer_test.py", line 7, in <module>
File "C:\ArcGIS\Desktop10.2\arcpy\arcpy\management.py", line 6043, in MakeFeatureLayer
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Features: Dataset D:/SWB/SWB_grid_builder_eq_area2.mdb/precip_sites_yr does not exist or is not supported
Failed to execute (MakeFeatureLayer).
I have checked it over and over. The FC exists and is just fine. The script worked in 10.1.
I've now tried it on five different MDBs and GDBs, and even a shape file. It worked on the GDBs and shape file but not on the MDBs. Is there something that needs to be done to the MDB or a different syntax?
Solved it!! personal geodatabases are Access, which only works with 32-bit aps, you have to specify which python.exe you run. For making feature layers with feature classes in MDBs, you have to run the python script using