I have developed a custom toolbox on ArcGIS 10.1. It has the following properties:

Name: SingleFDI
Label: SingleFDI
Alias: FFDI

In a Python script, I used arcpy.ImportToolbox to call a tool named FBFDRwMFDI in the toolbox.

TOOL_BOX_FILE_DIR = r'D:/aaa_workspace/SingleFDI/Models/SingleFDI.tbx'
model_result = arcpy.FBFDRwMFDI_FFDI(r'D:/aaa_workspace/SingleFDI, str(4))

I occasionally received the Object: Tool or environment <FBFDRwMFDI_FFDI> not found error. This happened roughly once every 5 times.

I am unable to tell why it happened because it was so random!

I read the ArcGIS help document. It states in

ImportToolbox(input_file, {module_name}), module_name{String}: If the toolbox does not have an alias, the module_name is required.

I would like to know what the module_name stands for in the syntax? Is it meant to be the Alias or Name property of the Toolbox? I ever tried using the Alias property in the ImportToolbox but the same error was still occuring occasionally and randomly.

  • If this is "occuring occasionally and randomly" on the same toolbox and tool, with the same code, then it sounds non-reproducible. – PolyGeo Nov 20 '17 at 4:53