Dear all,
I am writing a small Python script in ArcGIS and I am trying to loop through rows as can be seen in the figure below. However, I recieve an error saying that my file does not exist, even though I have copied the file path. The file has a data type: 'File Geodatabase Feature Class'.
I have also exported this feature class as a .shp shapefile. However I still recieve the same error.
So my question is how can make sure that my file is found so that my code works (if it is written correctly).
Thanks in advance!
Kind regards,
Marc
Solved! Go to Solution.
a shapefile would be in a folder and the *.shp file extension would be expected
your path contains spaces which isn't good and leading numbers for folders aren't great either.
Is the W drive local? a zip drive etc.
The file path, when you create a new one, should be raw encoded, (the little preceeding 'r') so try putting the shapefile into a simple folder path like
r"c:\data\my_shapefile.shp"
a shapefile would be in a folder and the *.shp file extension would be expected
your path contains spaces which isn't good and leading numbers for folders aren't great either.
Is the W drive local? a zip drive etc.
The file path, when you create a new one, should be raw encoded, (the little preceeding 'r') so try putting the shapefile into a simple folder path like
r"c:\data\my_shapefile.shp"
Thankyou it worked!
Dan mentioned several potential issues, please elaborate on what specifically "it" is that worked.
Replacing the spaces within the pathname by an undersquat made sure that the error dissapeared and the code could run.