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
You can use:
arcpy.GetInstallInfo()['Version']
Strip the ['version']
and you'll get back the entire dictionary of ArcGIS Pro info.
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