Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was handed off a a bunch of state shape files and wrote a script to add a few new fields and calculate some attributes. The first line in my script is -

arcpy.AddField_management('C:\WB_prj\cityPts\ghosts.gdb\vietnam_adm3_citypt_albers_ghost', 'City_cnt', 'SHORT', '#', '#', '#', '#', 'NULLABLE', 'NON_REQUIRED', '#')

I have all of the state shapefiles in a geodatabase. The script runs perfect for some of the files but for others I get an error that is shown below. My pathways are correct and I can manually add the fields through ArcMap but when I try and run the script for some of them I get the error. Any ideas on how to solve this? I'm running ArcGIS 10.0

File "C:\WB_prj\scripts\", line 79, in add_fields() File "C:\WB_prj\scripts\", line 14, in add_fields arcpy.AddField_management('C:\WB_prj\cityPts\ghost.gdb\vietnam_adm3_citypt_albers_ghost', 'City_cnt', 'SHORT', '#', '#', '#', '#', 'NULLABLE', 'NON_REQUIRED', '#') File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\", line 2625, in AddField raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Table: Dataset C:\WB_prj\cityPts\ghost.gdb ietnam_adm3_citypt_albers_ghost does not exist or is not supported Failed to execute (AddField).

share|improve this question







Your syntax of 'C:\WB_prj\cityPts\ghosts.gdb\vietnam_adm3_citypt_albers_ghost' will use the single "\" as an escape character and thus not work.

share|improve this answer
I solved this issue by using \\ in the pathway instead of a single \. 'C:\\WB_prj\\cityPts\\ghosts.gdb\\vietnam_adm3_citypt_albers_ghost' – user2284060 Jul 14 '13 at 20:04
Oops - the double slashes out in my second example did not show up due to formatting – PolyGeo Jul 14 '13 at 20:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.