Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As we know, there are few versions of ArcGIS (9.x,10) and Python(2.x,3.x) are in use. Issues are facing when we run scripts/toolbox of arcgis since the script written in one version of python and the python installed with arcgis is different version.

  1. How to identify python script version so that we can directly execute and save time?
  2. How to convert the existing python script to the installed python version on the system and get result without hassle of programming?
  3. Is there any procedure for ArcGIS to take python version 2/3.x as default so that, we can install multiple versions of python and change default version to run according to our requirement?
share|improve this question
What's the use case for having that many versions of Python installed on one system? Why don't you just support a single version? All Python scripts written for 9.3 will continue to work in 10.0 and 10.1, so a long as you develop against the lowest common denominator you should be fine. – Jason Scheirer Mar 26 '12 at 0:19
up vote 6 down vote accepted

1) There's no such thing as a script version, but there is a standard for defining package requirements for a Python interpreter version. See PEP 345:

2) Search for "2to3". It does not remove the "hassle" of programming.

3) In Python programming, we use virtualenv to juggle interpreters and specific sets of packages. I don't know if ArcGIS supports such virtual environments.

share|improve this answer

Every version of ArcGIS requires a specific Major.Minor version of Python (it uses the official installer releases from That version will be documented in the help. 9.3.X uses Python 2.5, 10.0 uses 2.6, 10.1 uses 2.7. Since the stack is compiled against a specific binary version of Python, other versions of Python will fail to load arcgisscripting and nothing will work.

You can use sys.version_info tuple to determine the Python version at runtime.

share|improve this answer
e.g., use sys.version_info[:2] >= (2, 5) to test if it is Python 2.5 or later – Mike T Mar 26 '12 at 4:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.