Saturday 16 March 2019

Running Different Versions of ArcGIS and Python?


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?



Answer



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: http://www.python.org/dev/peps/pep-0345/.


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.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...