I have a script that uses the Project geoprocessing tool and my script is giving me the "Parameters are not valid" error.
The weird thing is my script works fine in python 2.7 but not in the python environment created by ArcGIS Pro 3.0.3 (python 3.9.11). I have tried os.path.exists and it comes back as True in both versions. I have tried the tool in ArcGIS Pro using the same file paths, tool works, I then export the tool as python script, doesn't work.
workspaceforCodes = "W:\\GIS\\Tools\\WorkspacesForTools\\Sync.gdb"
PBCGIS_BaseConnection = "W:\\GIS\\WORKING FILES\\EM Working Files\\Databases\\Source.sde"
fcSource = PBCGIS_BaseConnection + "\\PARCELS"
projectedOutput = workspaceforCodes + "\\PARCELS_reprojected"
print("Cleaning up workspace. Removing old Reprojected Parcels.")
if arcpy.Exists(projectedOutput):
arcpy.Delete_management(projectedOutput)
try:
print("Reprojecting PARCELS to be Florida State Plane.") # arcpy.Project_management
arcpy.management.Project(in_dataset=fcSource, out_dataset=projectedOutput,
out_coor_system="102658",
transform_method="NAD_1983_To_HARN_Florida",
in_coor_system="102258",
preserve_shape="NO_PRESERVE_SHAPE", max_deviation="", vertical="NO_VERTICAL")
print("PAO.PARCELS dataset reprojected to 'NAD_1983_StatePlane_Florida_East_FIPS_0901_Feet'"
" from 'NAD_1983_HARN_StatePlane_Florida_East_FIPS_0901'")
except():
print("Projecting PBC Parcels failed. Check the variables for the 'Project' geoprocessing tool")