6

Is there a Pythonic way (e.g. arcpy, os) to detect which version of ArcGIS Pro is installed on a machine (e.g. 2.8.1 vs 2.8.2)?

I found a similar question for ArcPy in ArcMap (Detecting format/version of ArcMap toolbox using ArcPy), but am curious if Esri added the functionality. So far, I've looked in arcpy.Describe and os.environ

2 Answers 2

11

You can use:

arcpy.GetInstallInfo()['Version']

Strip the ['version'] and you'll get back the entire dictionary of ArcGIS Pro info.

3

I very much prefer @KHibma's answer, but it seems os.environ does indeed provide a clue, but not the full story:

import arcpy
import os

environ_details = os.environ
print(environ_details["ESRIACTIVEINSTALLATION"])
### conversely...
print(arcpy.GetInstallInfo()['Version'])

The above prints:

ArcGISPro2.8
2.8.1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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