ERROR 000732: Input Features: Dataset _  does not exist or is not supported

9230
4
Jump to solution
05-29-2012 12:26 PM
AvishekDutta
New Contributor
Hello,

I know people are not new to this error and some have actually overcome it. But strangely I have not been so lucky.

Here is my code

import arcpy  gaugeTablePath = arcpy.GetParameterAsText(0)   #input place = arcpy.GetParameterAsText(1) #input watershedTablePath = arcpy.GetParameterAsText(2) #input outFileName = arcpy.GetParameterAsText(3)  if arcpy.Exists(outFileName):         arcpy.AddMessage("File " + outFileName + " is deleted!!")         arcpy.Delete_management(outFileName)  row = arcpy.SearchCursor(gaugeTablePath, "\"STANDORT\"='"+place+"'","","PEGEL_NR")  gaugeStationNum = "" for line in row:     gaugeStationNum = line.PEGEL_NR  whereClause = '\"PEGEL_NR\"='+str(gaugeStationNum) wsTable = arcpy.Describe(watershedTablePath)  arcpy.Select_analysis(wsTable.basename,outFileName,whereClause)


I am running this script from inside the model builder.
This is the path of the feature class which does not exist!!!!!

H:\CIV\Customization_Exercise\LabExercise_1\File_Geodatabase.gdb\fd\watershed

As you can see it has no space, wrong slash or anything else. About the "." I cannot help.

this is the error I get...
<class 'arcgisscripting.ExecuteError'>: Failed to execute. Parameters are not valid.
ERROR 000732: Input Features: Dataset watershed does not exist or is not supported
Failed to execute (Select).


Strangely arcpy is able to Describe my "watershed" perfectly. Also "gauge" which is inside the same feature dataset is being found and operated on by SearchCursor perfectly.
Also worth mentioning is that arcpy.Exists() is also not working. Because I created the result file by normal select and hardcoding and it was there but still Exists returned 0.

I am at my wits end, please somebody help!!!

Thanks,
Avishek
0 Kudos
1 Solution

Accepted Solutions
DarrenWiens2
MVP Honored Contributor
What exactly are you using for your parameters? And, are they all entire file paths or file names (particularly "outFileName")?

edit: Oh. "wsTable.basename" would give you "watershed". That's not a file path, it's a word. Either set your workspace environment first, or change it to: arcpy.Select_analysis(watershedTablePath,outFileName,whereClause)

View solution in original post

0 Kudos
4 Replies
MathewCoyle
Frequent Contributor
The preferred syntax for describe should be .baseName
You should have spaces around your where clause operators.
None of those issues should give you that kind of error though.

I am a little confused by your description of your problem. Did it create the output or not? Is "H:\CIV\Customization_Exercise\LabExercise_1\File_Geodatabase.gdb\fd\watershed" the path to your input or output feature class?
0 Kudos
AvishekDutta
New Contributor
watershed is one the input's. No I am not getting the result. (watershed has no subtypes, I checked later!)

The task is to select the PEGEL_NR(gauge station number) corresponding to the place parameter from gauge feature class, and use it select the watershed polygon corresponding to that PEGEL_NR.

Sorry about that, but both basename and baseName are working.

Didn't understand which spaces you are talking about. Please explain.

The script didnot create a result. I did the task using other tools and created a file. I provided it as my output file name hoping that the script might work. Then I discovered arcpy.Exists() is also not working.

Hope this clears it up.

Avishek
0 Kudos
DarrenWiens2
MVP Honored Contributor
What exactly are you using for your parameters? And, are they all entire file paths or file names (particularly "outFileName")?

edit: Oh. "wsTable.basename" would give you "watershed". That's not a file path, it's a word. Either set your workspace environment first, or change it to: arcpy.Select_analysis(watershedTablePath,outFileName,whereClause)
0 Kudos
AvishekDutta
New Contributor
Phew!!!Setting the workspace and/or giving full path worked!!!!

Thanks a ton!!!..was pretty careless of me!!

But arcpy.Exists() is still not working!!!

outFileName - has the full path from the script parameter. I have deliberately kept the same output file name.

outFileName = arcpy.GetParameterAsText(3)


Also now the workspace is set to my feature dataset. I tried restarting ArcMAP.

Thanks in advance.
0 Kudos