Select to view content in your preferred language

Running a .py script on a server with both 32-bit and 64-bit python.exe

2711
2
02-17-2015 01:55 PM
AdamCrateau1
Occasional Contributor

I have a server with Server and Desktop installed locally.  I'm trying to run an arcpy script as a scheduled task, 'out-of-process', and it is not working.  Interesting some basic arcpy functions, such as arcpy.Exists(), are working, but most of the functions are not.  Also, when I explore into the arcpy folders in C:\Program Files\ArcGIS\Desktop10.2\arcpy\arcpy, many of my python scripts have corresponding compiled version (.pyc).  I believe I am pointed to the correct python.exe, as Desktop was installed after Server.  Any thoughts on what is happening?

0 Kudos
2 Replies
JoshuaBixby
MVP Esteemed Contributor

Do you have 64-bit Background Geoprocessing installed?  If so, then you might be running into an issue where a different ArcPy site package is being loaded than what you expect.  If you don't have 64-bit Background Geoprocessing installed, then the only issue should be which Python interpreter you are using, the 32-bit tied to Desktop or the 64-bit tied to Server.  In general, though, assuming which ArcPy site package is loaded based on ArcGIS installation order isn't a good practice.

You can find the path to the specific interpreter being used with sys.executable, just write a short script to dump that value to a file.  That being said, how are you running the scheduled task?  Are you specifying the Python executable and passing it your script as an argument or running the script directly and relying on Windows file extension associations to determine which interpreter is being used?

0 Kudos
AdamCrateau1
Occasional Contributor

Joshua,  Thanks for the response and useful info.  We just discovered what was happening:  The scheduled task we were running was trying to connect to data in a SQL database on another server. We needed to install the SQL-client software on the server in order to connect and communicate with the SQL server correctly.  During our tests, our SQL data and ArcServer were both on the same box, and the client was installed with the SQL install.  A simple thing to overlook - maybe the client software should be an option during the Server install, or even the Desktop install?

Thanks again for your response.

0 Kudos