I have a script that starts by creating a FileGDB by calling arcpy.CreateFileGDB_management.
It runs without error on my own laptop, but raises an error when my colleagues try to run it outside of ArcGIS Pro.
This is the code I'm trying to run:
import arcpy arcpy.env.workspace = "C:\\LOCAL\\Project" home = "C:\\LOCAL\\Project" GDB = "test.gdb" arcpy.CreateFileGDB_management(home, GDB)
But it gives the following error:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 20234, in CreateFileGDB raise e File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 20231, in CreateFileGDB retval = convertArcObjectToPythonObject(gp.CreateFileGDB_management(*gp_fixargs((out_folder_path, out_name, out_version), True))) File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 498, in <lambda> return lambda *args: val(*gp_fixargs(args, True)) RuntimeError: Object: Error in executing tool
When run from the Python window inside ArcPro there's no issue, it only happens when it's run from outside.
I've tried to run it in 2 different ways:
- In PyCharm by setting the interpreter to C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe
- Inserting the code one-by-one directly in C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe
I've tested this on 2 different devices, both giving the same error.
The complete script works on my own laptop but I can't seem to get it to work on other devices. It feels like I'm overlooking a setting somewhere.