ERROR 000354: The name contains invalid characters Failed to execute (CreateFeatureclass).

3653
7
Jump to solution
02-21-2024 12:24 PM
SamStafford
Emerging Contributor

line 107, in <module>
output_point_fc = arcpy.management.CreateFeatureclass(gdb_path, "Point_Output", "POINT", "", "DISABLED", "DISABLED", utm_spatial_ref)
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 3451, in CreateFeatureclass
raise e
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 3448, in CreateFeatureclass
retval = convertArcObjectToPythonObject(gp.CreateFeatureclass_management(*gp_fixargs((out_path, out_name, geometry_type, template, has_m, has_z, spatial_reference, config_keyword, spatial_grid_1, spatial_grid_2, spatial_grid_3, out_alias), True)))
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: ERROR 000354: The name contains invalid characters
Failed to execute (CreateFeatureclass).

 

This is happening on this line: 

output_point_fc = arcpy.management.CreateFeatureclass(gdb_path, "Point_Output", "POINT", "", "DISABLED", "DISABLED", utm_spatial_ref)

 

This was never an issue until I switched laptops, but now I get this error every time I try to create feature class.  Any suggestions?

 

0 Kudos
1 Solution

Accepted Solutions
CodyPatterson
Frequent Contributor

Hey @SamStafford 

That is super strange, possibly could be worthwhile to use this arcpy module to see if it changes the name of the gdb at all?

test_name = arcpy.ValidateTableName("Point_Output", gdb_path)

I'd print the test_name and see if it's also "Point_Output" also maybe try to change it to "PointOutput" or "test" just to see the different options? Nothing seems wrong with the name itself, but could be something strange!

Cody

View solution in original post

7 Replies
CodyPatterson
Frequent Contributor

Hey @SamStafford 

You mentioned you changed laptops, does your gdb_path still point to the same location on the new laptop? I'm wondering if this may need changed or now contains incorrect symbols/words/spaces.

Hope that helps!

Cody

0 Kudos
SamStafford
Emerging Contributor

Thanks for the reply Cody. My GDB path is the same name as it was previously: 

gdb_path = r'C:\Users\XXXXXXXX\PycharmProjects\arcgis_pro\GDB_files\od.gdb'

 

0 Kudos
CodyPatterson
Frequent Contributor

Hey @SamStafford 

Could there be any chance that the path is different than what it is on the current machine? Maybe the gdb may not be in the same location perhaps?

I've had the error come up when I attempt to use locations that are not valid or in the right location before.

Hope that helps!

Cody

0 Kudos
SamStafford
Emerging Contributor

Thanks again for the reply Cody. It shouldn't be an issue since I moved over the GDB file in my Pycharm projects folder. With that said, I've also relocated it to my desktop and attempted to utilize it from there. I'm still running into the same error

0 Kudos
CodyPatterson
Frequent Contributor

Hey @SamStafford 

That is super strange, possibly could be worthwhile to use this arcpy module to see if it changes the name of the gdb at all?

test_name = arcpy.ValidateTableName("Point_Output", gdb_path)

I'd print the test_name and see if it's also "Point_Output" also maybe try to change it to "PointOutput" or "test" just to see the different options? Nothing seems wrong with the name itself, but could be something strange!

Cody

SamStafford
Emerging Contributor

Thanks, I had previously tried altering the names as you'd suggested. I've been trying to fix this for weeks and no changes seemed to impact the error. 

 

I finally tried to generate another .gdb file and it worked. It looks like I had somehow corrupted the .gdb file when transferring between pcs. Anyway, I wanted to say thanks for all of your help and let you know that the issue is resolved.

0 Kudos
CodyPatterson
Frequent Contributor

Hey @SamStafford 

Glad to hear it got worked out! It is quite strange how it doesn't completely show there's a corruption or not, some things are quite subtle when working with the db files.

Cody

0 Kudos