Why are my shapefiles not working in ArcPy?

Why are my shapefiles not working in ArcPy?

This is because it worked for the first Shapefile as you were testing but the second time you ran it the featureclass existed and it wouldn’t overwrite it. Thus causing it to fail. List your shapefiles in in_features and let us know if it works.

How to add shapefile to a new MXD?

I assume you’re wanting to add a shapefile to an new mxd. First you need to create a blank mxd by opening ArcMap and Save As to create a blank mxd. Then make a feature layer of your shapefile and then add it to the mxd. For starters, you are going to need to save your shapefile to an .MXD.

Is there a way to overwrite a shapefile in ESRI?

Your example is right from the Esri. It works but in your case you need to add arcpy.env.overwriteOutput = True after the import. This is because it worked for the first Shapefile as you were testing but the second time you ran it the featureclass existed and it wouldn’t overwrite it.

How to copy multiple shape files to a geodatabase?

I am trying to copy multiple shape files to a file geodatabase using python. I have been able to copy single .shp files to a geodatabase. Doing this one at a time is tedious and seems easier to do in ArcMap. I have enclosed the code I am using to do one at a time.

Where do I put my folder in ArcPy?

Normally, you need to specify your folder in a file geodatabase, personal geodatabase or RDBMS table instead of a folder. But i skipped that question and gave a sample code for you above. Anyway, I prepare some code for you.

How to loop through ArcGIS tables in Python?

I have arcgis tables for each US state (plus DC and Puerto Rico). I want to iterate through those tables in a folder, join each one at a time to a shapefile, copy the joined features to a new featureclass in a different geodatabase, name that featureclass after the respective state name, then remove the join and move on to the next state.