# Running model from ArcPy?

I am using arcGIS 10.0 SP5

I have the following code :

import arcpy

arcpy.ImportToolbox(r"C:\Documents and Settings\Derek\FRAME\FORTEST.tbx", "Derek")

arcpy.TEST_Derek()


The model is names TEST The toolbox alias is Derek

When I try and run this I get an error

AttributeError: 'module' object has no attribute 'TEST_Derek"


What I want to do is to run the model TEST from the toolbox FORTEST

• When you right click on the model in the toolbox and go to properties under the general tab confirm that Name is TEST and not Label. Label is the user friendly text, Name is the Name you hook into to run the model. Also confirm your FORTEST.tbx really does have an alias called Derek. On a side note "Derek" is not a very sensible alias as it describes nothing about the toolbox... – Hornbydd Feb 26 '14 at 13:04
• Hi. Thanks for the comment. I have checked that the name of the model is indeed called TEST and the label is also called TEST. The toolbox is called FORTEST and the label is also called FORTEST and the Alias is called Derek. I realise that it is a silly alias but it is for testing only prior to adding to a larger python script – DerekB Feb 26 '14 at 13:17
• I have run trials using this code on arcGIS 10.1 and it runs perfectly but I am using arGIS 10.0 – DerekB Feb 26 '14 at 14:24
• Try saving the toolbox as version 10.0 from your 10.1 machine? – Hornbydd Feb 26 '14 at 14:29