dannzn

Unable to use arcgisscripting

Discussion created by dannzn on May 25, 2011
Latest reply on May 25, 2011 by dannzn
Below is the first few lines of a script that I am trying to run from a web.page. I have verified that it runs fine from python but seems fail on the first use of gp when run programaticly.

At first I thought the AddToolBox method was failing due to an incorrect path but as I said everything runs fine when run directly from python.

I tried adding the line "gp.SetProduct("ArcInfo") " before the ToolBoxLoad and now it fails so it seems to be any use of gp. causing issues.

This is ArcGIS10 using Python26 and everything ran fine using the same code/scripts on a machine with ArcGIS9.3 and Python25.

Any insight would be greatly appreciated as I am officially stumped.



import sys, string, os, arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

gp.SetProduct("ArcInfo") 

gp.AddToolbox("C:/Program Files (x86)/ArcGIS/Desktop10.0/ArcToolbox/Toolboxes/Data Management Tools.tbx")

Outcomes