# Can I use python 2.6 with ArcGIS 9.3?

Is it possible to use Python 2.6 (or 2.7?) with ArcGIS 9.3?

The official stance is no, not supported. There are a number of reports in the wild though that it can be done. How is this accomplished? and is there anything to watch out for?

-

In all ArcGIS 9 versions you can upgrade python to the latest and greatest version with a few simple steps. Here's the recipe for 9.3 and 2.6:

• Install python 2.6, and the latest corresponding pywin32.
• Grab the arcgisscripting.py script written by Philippe Le Grand (see this thread in the ESRI scripting forum) and plop it into C:\Python2.6\Lib\site-packages
• Make sure PYTHONPATH environment variable points to C:\path\to\ArcGIS\bin

This is an unsupported configuration, see ESRI knowledgebase article 31912.

-
All is not completely well though, I recently discovered that gp.ListDatasets() breaks in py2.6 with "This object does not support enumeration" –  matt wilkie Sep 27 '10 at 22:39
The issue gp.ListDatasets() has something to do with arcgis changing from enumerators to lists, also see this in 9.2 to 9.3 for some methods. Not sure why this didn't become an issue at this point, when it didn't surface with py2.5 and 9.3. See (gis.stackexchange.com/questions/10922/…) for solution –  matt wilkie Feb 2 '12 at 18:31

Do you have any compelling reason to upgrade beyond 'because I want to?' Most popular third-party Python libraries are available for 2.5 and there's no point in risking major compatibility issues. arcgisscripting should fail and throw with an error like "use of python25.DLL conflicts with this version of Python" when importing a 9.3.X arcgisscripting in Python 2.6 or beyond.

-
The main impetus is that my text editor / IDE of choice, leo-editor, requires 2.6+. I've not encountered the dll conflict message and I've been upgrading beyond the ESRI shipped python since py2.1 (using the recipe in the other answer). However it should be noted I only use a small subset of the geoprocessing tools and there may well be incompatibilities yet to be uncovered. –  matt wilkie Sep 28 '10 at 16:05