Which ArcPy (Desktop or Server)?

294
3
Jump to solution
10-09-2013 06:31 PM
NeoGeo
by
Occasional Contributor III
While trying to troubleshoot ArcPy import problems on scripts that had been running fine for years until now, I became aware that there are two separate installations, one for server and one for desktop.

1)For scripts being run on a scheduled basis, what determines which is used?  Is it just the first one listed in sys.path? 
2) Can standalone scripts on the ArcGIS server use the server installation, or do they have to use the Desktop installation?
3)Do geoprocessing services always use the server installation no matter what? (I assume yes)
4)I notice that my 10.1 server by default installed server10.1.pth in the c:\python27\ArcGISx6410.1\Lib\site-packages whereas the desktop10.1.pth is in c:\python27\ArcGIS10.1\Lib\site-packages.  Is this really best practice or should I have both use the 32 bit version?

Thank you!
0 Kudos
1 Solution

Accepted Solutions
KevinHibma
Esri Regular Contributor
1)For scripts being run on a scheduled basis, what determines which is used? Is it just the first one listed in sys.path?
>>  on a default install, Python doesn't get put into the PATH. What happens is the last Python (32 or 64 bit) that gets installed is the one file associations are set to. So if you double click a script in Explorer, whatever the last Python (Arc* product) installed is what it'll run under.

2) Can standalone scripts on the ArcGIS server use the server installation, or do they have to use the Desktop installation?
>> yes. You can control what Python you execute against. See this blog topic. It's on 64bit Background, but the same applies for 64bit Server. http://blogs.esri.com/esri/arcgis/2012/11/12/python-scripting-with-64-bit-processing/

3)Do geoprocessing services always use the server installation no matter what? (I assume yes)
>> yes.

4)I notice that my 10.1 server by default installed server10.1.pth in the c:\python27\ArcGISx6410.1\Lib\site-packages whereas the desktop10.1.pth is in c:\python27\ArcGIS10.1\Lib\site-packages. Is this really best practice or should I have both use the 32 bit version?
>> You need both. You have and need a 32bit and 64bit version of Python. If you modify those files bad things may happen. "Dont cross the bits!" :)

View solution in original post

0 Kudos
3 Replies
KevinHibma
Esri Regular Contributor
1)For scripts being run on a scheduled basis, what determines which is used? Is it just the first one listed in sys.path?
>>  on a default install, Python doesn't get put into the PATH. What happens is the last Python (32 or 64 bit) that gets installed is the one file associations are set to. So if you double click a script in Explorer, whatever the last Python (Arc* product) installed is what it'll run under.

2) Can standalone scripts on the ArcGIS server use the server installation, or do they have to use the Desktop installation?
>> yes. You can control what Python you execute against. See this blog topic. It's on 64bit Background, but the same applies for 64bit Server. http://blogs.esri.com/esri/arcgis/2012/11/12/python-scripting-with-64-bit-processing/

3)Do geoprocessing services always use the server installation no matter what? (I assume yes)
>> yes.

4)I notice that my 10.1 server by default installed server10.1.pth in the c:\python27\ArcGISx6410.1\Lib\site-packages whereas the desktop10.1.pth is in c:\python27\ArcGIS10.1\Lib\site-packages. Is this really best practice or should I have both use the 32 bit version?
>> You need both. You have and need a 32bit and 64bit version of Python. If you modify those files bad things may happen. "Dont cross the bits!" :)
0 Kudos
NeoGeo
by
Occasional Contributor III
Great information.  Thank you!!!
0 Kudos
DaleHoneycutt
Regular Contributor
Since you're scheduling a script, I thought I might mention this recent blog post on scheduling Python scripts -- it shows how to discover the "default" Python being run.  Scheduling a Python script or model to run at a prescribed time
0 Kudos