Publishing geoprocessing service takes forver

2865
3
12-27-2013 12:38 PM
ShawnCarson
New Contributor III
Here is an odd one. I am trying to publish a geoprocessing service (a python script). It published without issues last week. Lately however when I try and re-publish, it takes over 30 minutes to publish. After much digging around I found the slowness  to be attributed to the following two lines at the top of my python script:

**************
import os
import uuid
**************

In test cases I remove these lines and the service publishes in 5 seconds. When I include these lines it takes 30 minutes...
The script in toolbox always runs fast, its just when I try and publish as a service is when it gets slow.

I don't know what I did (if anything) to cause this slowness. I even re-installed Desktop and Server and its still slow when I use the above import statements.

Does anyone know of anything I can do  to get the service to find the libraries quickly when publishing teh service?
Maybe I can set the path to these libraries explicitly so the service isn't  looking around forever?

Thanks for any ideas.

Shawn
Tags (2)
0 Kudos
3 Replies
WilliamCraft
MVP Regular Contributor
Interesting.  You might first try adding each of those two lines separately and re-attempting service publishing to see if it's one of them specifically that's causing issues or if it's both of them.
0 Kudos
ShawnCarson
New Contributor III
Good test. Thanks for the suggestion. I did that and either library causes the issue. Importing  arcpy by itself creates the service quickly. I think it must be something to do with any python libraries, earlier I was having issues with running python in ArcGIS so I set my environment variables which fixed that issue but may have causes this new problem.
0 Kudos
ShawnCarson
New Contributor III
I solved this by removing all references to my PYTHONPATH variables in Environment Variables-->System Variables (?) . The service isnow created in 10 seconds.

I am not sure how python is being "found" without any of these variables being set but python is working using IDLE,  PyScripter,  and within ArcGIS.
0 Kudos