what is the error message?
# --------------------------------------------------------------------------- # NeighborScore.py # Created on: 2013-01-07 13:26:35.00000 # Updated on: 2014-02-12 # Description: Will create output tables based on the average and sum of neighboring polygon values # --------------------------------------------------------------------------- #B comment: I believe this is as the script was delivered on Feb 12 2014 #B comment: See most recent NeighborScore_Working version for most current version try: import sys import traceback import scipy.ndimage import numpy,arcpy import string import PIL.Image arcpy.env.overwriteOutput = True inpRaster=arcpy.GetParameterAsText(0) desc = arcpy.Describe(inpRaster) layersource = desc.catalogPath imageread=scipy.ndimage.imread(layersource) sobelimage=scipy.ndimage.sobel(imageread,0) outimage=PIL.Image.fromarray(sobelimage) Out=outimage.save('D:\Outputs\sobel.jpg') except arcpy.ExecuteError: print "error" msgs = arcpy.GetMessages(2) arcpy.AddError(msgs) print msgs except: print "error" tb = sys.exc_info()[2] tbinfo = traceback.format_tb(tb)[0] pymsg = "PYTHON ERRORS:\nTraceback info:\n" + tbinfo + "\nError Info:\n" + str(sys.exc_info()[1]) msgs = "ArcPy ERRORS:\n" + arcpy.GetMessages(2) + "\n" arcpy.AddError(pymsg) arcpy.AddError(msgs) print pymsg + "\n" print msgs
Try running this version with an error handler and see if you get an error message to post.# --------------------------------------------------------------------------- # NeighborScore.py # Created on: 2013-01-07 13:26:35.00000 # Updated on: 2014-02-12 # Description: Will create output tables based on the average and sum of neighboring polygon values # --------------------------------------------------------------------------- #B comment: I believe this is as the script was delivered on Feb 12 2014 #B comment: See most recent NeighborScore_Working version for most current version try: import sys import traceback import scipy.ndimage import numpy,arcpy import string import PIL.Image arcpy.env.overwriteOutput = True inpRaster=arcpy.GetParameterAsText(0) desc = arcpy.Describe(inpRaster) layersource = desc.catalogPath imageread=scipy.ndimage.imread(layersource) sobelimage=scipy.ndimage.sobel(imageread,0) outimage=PIL.Image.fromarray(sobelimage) Out=outimage.save('D:\Outputs\sobel.jpg') except arcpy.ExecuteError: print "error" msgs = arcpy.GetMessages(2) arcpy.AddError(msgs) print msgs except: print "error" tb = sys.exc_info()[2] tbinfo = traceback.format_tb(tb)[0] pymsg = "PYTHON ERRORS:\nTraceback info:\n" + tbinfo + "\nError Info:\n" + str(sys.exc_info()[1]) msgs = "ArcPy ERRORS:\n" + arcpy.GetMessages(2) + "\n" arcpy.AddError(pymsg) arcpy.AddError(msgs) print pymsg + "\n" print msgs