AnsweredAssumed Answered

arcpy.Exists working in interactive window but not stand-alone script

Question asked by allisonb on Sep 1, 2017
Latest reply on Sep 5, 2017 by rastrauch

I am having trouble with the arcpy.Exists() function in a script to check the existence of a table in a personal geodatabase.   When I test in the ArcToolbox Python window, I get the correct result, True, for a table that exists.   When I use the same commands in a stand-alone script, regardless of how I construct the path string, it always returns False for the table.    I also tested just the geodatabase, and it returns True, so it is not having trouble finding the geodatabase itself.  

 

Below is the code from the script.   When I run from the interactive window, I just remove the print statement.

 

import arcpy


print arcpy.Exists("Y:/projects/dnr_svmp2016/db/SVMP_2000_2015_DB.v52_20170803/SVMP_DB_v5.2_20170803_AB.mdb/site_samples")
print arcpy.Exists("Y:\projects\dnr_svmp2016\db\SVMP_2000_2015_DB.v52_20170803\SVMP_DB_v5.2_20170803_AB.mdb\site_samples")
print arcpy.Exists("Y:\\projects\\dnr_svmp2016\\db\\SVMP_2000_2015_DB.v52_20170803\\SVMP_DB_v5.2_20170803_AB.mdb\\site_samples")
print arcpy.Exists("Y:/projects/dnr_svmp2016/db/SVMP_2000_2015_DB.v52_20170803/SVMP_DB_v5.2_20170803_AB.mdb")

 

This script returns:

False

False

False

True

 

Here is  screenshot of the interactive window:

Screen shot of same commmands in ArcToolbox Python window

 

 

I'm hoping that the solution is something very obvious that I am just missing right now!   Thanks for any help.

Outcomes