Select to view content in your preferred language

Python 26 or Python 27 under arcgis 9.3.1

764
3
12-19-2010 01:45 AM
HolmSeifert
Emerging Contributor
Hallo,

can anyone give me some advices to run python 2.6 or pyton 2.7 under arcgis 9.3.1?
I need some functions which are only available under the newer python versions.

Thanks
Holm
Tags (2)
0 Kudos
3 Replies
V_StuartFoote
MVP Frequent Contributor
Holm,

The arcgisscripting Python module is hard coded for v2.5; but can be configured to use a 2.6 or 2.7 release (no 3.0).  Also, because of the move beyond a simple module (arcgisscripting) to a full site library (ArcPy)--the same is not true with ArcGIS 10. Many compiled dependencies, both Python and Numpy,  get broken.

For ArcGIS 9.3 there is some coverage in the current ArcGIS Forums and some meat in the old forums, but best resources for the topic are over on the GIS Stackexchange. Read both of these threads to start:
[INDENT]http://gis.stackexchange.com/questions/2226/can-i-use-python-2-6-with-arcgis-9-3

http://gis.stackexchange.com/questions/609/will-arcgis-10-support-python-2-7-or-python-3-1[/INDENT]

Good luck.

Stuart
0 Kudos
NiklasNorrthon
Frequent Contributor
Given that you have pywin32 installed you can try this hack:
try:
    import arcgisscripting
except ImportError:
    import win32com.client
    class arcgisscripting(object):
        @staticmethod
        def create():
            return win32com.client.Dispatch('esriGeoprocessing.GpDispatch.1')


This will make decouple the python version from the ArcGIS version. The drawback is that you won't be able to use arcpy or the create(9.3) variations.

To iterate a list you do this:
feature_classes = gp.ListFeatureClasses()

for fc in iter(feature_classes.Next, None):
    print fc

0 Kudos
JasonScheirer
Esri Alum
What functions do you need? There may very well be a version of the functionality you need for older versions.
0 Kudos