Python script executes in Desktop but not as published GP service

Discussion created by puuri on Mar 4, 2014
Latest reply on Oct 15, 2014 by puuri
I have a python script that uses a module called ibm_db for accessing a DB2 database.  The script executes fine from ArcCatalog 10.1 and I can successfully publish it as a geoprocessing service.  However when I try to execute the actual service, the underlying python script fails with an error message coming from my import statement at the top of the code with ???import <list of modules> ImportError: no module named ibm_db???.  On this machine I have ArcGIS Desktop 10.1 as well as ArcGIS for Server 10.1.  I also have two python folders under C:\Python27, an ArcGIS10.1 and an ArcGISx6410.1.  I believe one is laid down with the Desktop install and the other when Server was installed.  The module that is failing has a 32 bit egg and a 64 bit egg that I installed in the Lib\site-packages under each respective python folder.  I actually had this working at one time in the past, but a server rebuild has precipitated the need to re-establish the environment and I have tried all manner of PYTHONPATH permutations in the environment variable as well as the registry to no avail.  I am pretty sure it is path related, or possibly permission related if the GP service is running as a user that may not have permission in the python folder, but what user would that be?  The arcgis system account?  Any ideas that anyone out there might have for me to try would be greatly appreciated.

Jeff Puuri
Applications Consultant
Roanoke, VA