# Import system modules import arcpy from arcpy import env import os # Set environment settings env.workspace = "C:/Users/a391665/Documents/AAAAPERSONALE/rugareto" # Execute CreateFileGDB arcpy.CreateFileGDB_management("C:/park", "test4") # Set local variables outWorkspace = "c:/park/test4.gdb" # Use ListFeatureClasses to generate a list of shapefiles in the # workspace shown above. fcList = arcpy.ListFeatureClasses() # Execute CopyFeatures for each input shapefile for shapefile in fcList: # Determine the new output feature class path and name outFeatureClass = os.path.join(outWorkspace, shapefile.strip(".shp")) arcpy.CopyFeatures_management(shapefile, outFeatureClass)
arcpy.CopyFeatures_management(shapefile, outWorkspace + os.sep + shapefile.rstrip(".shp"))
What does the error say (if any)? It shouldn't have anything to do with your licenses, both tools you use are available to ArcView.
edit: maybe try:arcpy.CopyFeatures_management(shapefile, outWorkspace + os.sep + shapefile.rstrip(".shp"))
# Set environment settings env.workspace = "C:/Users/a391665/Documents/AAAAPERSONALE/rugareto" # Execute CreateFileGDB arcpy.CreateFileGDB_management("C:/park", "test4") # Set local variables outWorkspace = "c:/park/test4.gdb"
# Set environment settings env.workspace = "C:\\Users\\a391665\\Documents\\AAAAPERSONALE\\rugareto" # Execute CreateFileGDB arcpy.CreateFileGDB_management("C:\\park", "test4") # Set local variables outWorkspace = "c:\\park\\test4.gdb"
I would try changing the following section of code# Set environment settings env.workspace = "C:/Users/a391665/Documents/AAAAPERSONALE/rugareto" # Execute CreateFileGDB arcpy.CreateFileGDB_management("C:/park", "test4") # Set local variables outWorkspace = "c:/park/test4.gdb"
to# Set environment settings env.workspace = "C:\\Users\\a391665\\Documents\\AAAAPERSONALE\\rugareto" # Execute CreateFileGDB arcpy.CreateFileGDB_management("C:\\park", "test4") # Set local variables outWorkspace = "c:\\park\\test4.gdb"
ExecuteError: ERROR 000258: Output C:\park\test4.gdb already exists
Failed to execute (CreateFileGDB).
if os.path.exists("c:/park/test4.gdb"): arcpy.Delete_management("c:/park/test4.gdb")
Do you have a file called "Percorsi.shp"? In the folder "C:/Users/a391665/Documents/AAAAPERSONALE/rugareto"?
Also, after you import os, check if the gdb exists. If it does, delete it.if os.path.exists("c:/park/test4.gdb"): arcpy.Delete_management("c:/park/test4.gdb")
Sorry guys, I noticed.
Your help is so precious.
I wasn't able to add the "overwrite..." but I deleted the gdb and got it working from the PythonWin.
Although I have this error in the Python Win:
Runtime error <class 'arcgisscripting.ExecuteError'>: Failed to execute. Parameters are not valid. ERROR 000732: Input Features: Dataset Percorsi.shp does not exist or is not supported Failed to execute (CopyFeatures).
>>>