Pythonaddins not working for ArcGIS 10.3.1

06-08-2015 10:48 AM
New Contributor


I wrote a python tool using pythonaddins in ArcGIS 10.1. The tool works perfectly on ArcGIS 10.1 and 10.2. But I am unable to run the tool on ArcGIS 10.3.

Here is my python code snippet:

def onMouseDownMap(self, x, y, button, shift):
        #setup workspace location
        arcpy.env.workspace = r"" + self.inFile 
        #list all rasters
        rasters = arcpy.ListRasters("*", "TIF")
        #CSV file
        csv_file = arcpy.env.workspace + "\output.csv"
        #define output rows list
        rows = []
        #define output layers list
        layers = []
        #loop through all raster files and get cell values
        for raster in rasters:
            result = arcpy.GetCellValue_management(raster, "{} {}".format(x, y), "1").getOutput(0)
        #open the csv file and append values for each click on the raster map
        with open(csv_file, 'a') as outcsv:
            #configure writer to write standard csv file
            writer = csv.writer(outcsv, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL, lineterminator='\n')
            #print x, y in csv
            writer.writerow(['x', 'y'])
            #print x, y location in csv
            writer.writerow([str(x), str(y)])
            #print Layer, Value in csv
            writer.writerow(['Layer', 'Value'])
            #get row length
            rowlen = len(rows)
            #loop through the rows and print output to csv
            for i in range(0, rowlen):
                writer.writerow([layers, rows])

And here is my config.xml file look like:

<ESRI.Configuration xmlns="" xmlns:xsi="">
    <Description>A python addins tool to get cell value of raster files</Description>
    <Author>Yamin Noor</Author>
        <Target name="Desktop" version="10.1" />
    <AddIn language="PYTHON" library="" namespace="GetRasterCellValue_addin">
                <Tool caption="GRCV" category="GetRasterCellValue" class="GRCV" id="GetRasterCellValue_addin.GRCV_1" image="Images\Other.png" message="Get Raster Cell Value" tip="Use this tool to get raster cell value">
                    <Help heading="Get Raster Cell Value">Get Raster Cell Value</Help>
                <Toolbar caption="GRCV" category="GetRasterCellValue" id="GetRasterCellValue_addin.GRCV" showInitially="true">
                        <Tool refID="GetRasterCellValue_addin.GRCV_1" />

I am not sure if changing the target version (to 10.3) in config.xml would make any difference. i.e

<Target name="Desktop" version="10.1" />


Message was edited by: Yamin Noor

0 Kudos
5 Replies
Regular Contributor II

Have you tried changing line 11 in your config.xml to:

<Target name="Desktop" version="10.3" /> 

This would reflect the current release that you are on.

What is the exact problem that you are having with your addin?  Is it just not loading or something else?

0 Kudos
MVP Esteemed Contributor

Hi Yamin,

ArcGIS 10.2 was backward compatible with 10.1. So, the Add-ins built in 10.1 worked with 10.2, but ArcGIS 10.3 is not backward compatible with 10.1.

Maybe the Python experts can help you get out of it.

cc Xander BakkerDan Patterson

Think Location
0 Kudos
MVP Esteemed Contributor

I doubt it would be as simple as changing the xml.  Perhaps the differences are like the transition from ArcView 3.x upward (worst case scenario) or the horrendous well-know location where add-ins are looked for.  It can't be python assuming that both use python 2.7.  It has to be more difficult than that​

0 Kudos
New Contributor II

Dan, you are correct: it was not as simple as changing the xml and rebuilding the Addin.  Did that and still having problems.  Biggest problem is that the Python Addin will absolutely not work now from a shared network Addin folder.  Installing the Addin from the local C: drive will get it to work for a while, but it inevitably fails after running a few times, which then requires a restart to clear things out so the tool will begin running again.  Same Addin had been running without problem in 10.2 for a couple of years prior to our recent ArcGIS 10.3.1 upgrade.

0 Kudos
New Contributor


No its still not working for me on ArcMap 10.3+ but works on ArcMap 10.1 and 10.2. I now have another issue to deal with pythonaddins tool. I developed another separate tool to create rectangle fishnet. It works like charm but after exactly 9 clicks on the map ArcMap crashes to desktop. I have tested this on ArcMap 10.1 and 10.2.


0 Kudos