I created a python script in model builder in ArcGIS Pro and tried to run it on ArcGIS Server 10.8.1, only to find out Server only uses Python 2.7 and Pro outputs the script in 3.
I am considering attempting to recreate the script in ArcMap 10.7 model builder to get around this problem since I read that ArcMap outputs to 2.7.x.
I am just wondering if my theory is true?
Thank you in advance!
ArcGIS Server has a "hidden" python 3 environment, that's why you can publish web tools to it from ArcGIS Pro. but this python 3 environment does not include all the packages you have in the ArcGIS Pro Python environment. You can think this is a stripped down version of the python environment coming with your ArcGIS Pro....
How did you run your script in ArcGIS Server? if you tried sharing a web tool from ArcGIS Pro and it did not work, then I guess some packages you are using in your script are missing in the ArcGIS Server Python 3 environment.
If you could achieve the same function in ArcMap, definitely try ArcMap, as the 2.7.x environment is default environment for ArcGIS Server 10.8.x, you'll have a better chance.
That's super interesting about the "hidden" python environment.
I am running the .py script I created from ArcMap through a .bat file that calls the python.exe and uses the script path as the argument.
Most of the script works... running into some bugs though.
I'll keep y'all posted!
Maybe I should be more accurate, It's not "hidden", it's just not the default python environment.
You can find it here, depending on your ArcGIS Server installation