Select to view content in your preferred language

arcpy.Exists not locating an existing feature class.

435
2
Jump to solution
03-23-2024 10:38 AM
MatthewHershberger01
New Contributor

Please excuse my (very) novice understanding of this issue. I have this code:

import arcpy
from arcpy import env
env.workspace = "C:/Users/matth/Desktop/CSULB/Richards_605/Geoproccessing/Geoproccessing.gdb"
env.overwriteOutput = True

def myDescFunction(fc):
print('Processing {}'.format(fc))
if arcpy.Exists(fc):
desc = arcpy.Describe(fc)
print("the base name for {0} is {1}".format(fc, desc.baseName))
print(desc.shapeType)
print(desc.dataType)
else:
print("Did not find the feature class: " + fc)

if __name__ == "__main__":
myDescFunction("C:\\Users\\matth\\Downloads\\HBCentral.gdb\\HBCentral.gdb\\Address\\SiteAddressPoint")

 

And it's returning:

"C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe" C:\Users\matth\PycharmProjects\pythonProject1\env.py
Processing C:\Users\matth\Downloads\HBCentral.gdb\HBCentral.gdb\Address\SiteAddressPoint
Did not find the feature class: C:\Users\matth\Downloads\HBCentral.gdb\HBCentral.gdb\Address\SiteAddressPoint

Process finished with exit code 0

I have verified that I am using a completely identical code to a colleague w/ same format and they received:

MatthewHershberger01_0-1711215438048.png

 

0 Kudos
1 Solution

Accepted Solutions
MatthewHershberger01
New Contributor

UPDATE: It seems moving the folder off of my downloads location to elsewhere fixed the issue!

View solution in original post

0 Kudos
2 Replies
MatthewHershberger01
New Contributor

UPDATE: It seems moving the folder off of my downloads location to elsewhere fixed the issue!

0 Kudos
RhettZufelt
MVP Notable Contributor

shouldn't have an issue withe the download folder, suspect the issue is that your connect string says you have a FGDB stored inside a FGDB.

 myDescFunction("C:\\Users\\matth\\Downloads\\HBCentral.gdb\\HBCentral.gdb\\Address\\SiteAddressPoint")
0 Kudos