Select to view content in your preferred language

publish gp service with python dependencies   HELP!!

849
5
11-13-2013 04:52 PM
FangmingDu
Deactivated User
Hello,

I wrote several python classes myself and which is called from a python script in one custom toolbox created myself.

It works perfectly in desktop.
But when I publish it as a service on arcgis server, it seems like it cannot find the dependency files...

What should I do????

HELP!!
0 Kudos
5 Replies
JonathanQuinn
Esri Notable Contributor
What version are you using?  If you're at 10.1 or greater, if you look in the arcgisinput folder on the server, (C:\arcgisserver\directories\arcgissystem\arcgisinput\<service>.GPServer\extracted\v101), are all dependent files copied over correctly?  If not, does the ArcGIS Server account have at least read access to wherever those dependent files are?
0 Kudos
DaleHoneycutt
Deactivated User
The topic Authoring geoprocessing tasks with Python scripts  might be helpful.  It has a section about how imported libraries are handled when published to server.  The help topic dives into behind-the-scenes details of script consolidation.
0 Kudos
FangmingDu
Deactivated User
Hello,

Thanks for the reply.
I'm using 10.1 server. I saw the path where I can copy the file over. I thought there might be an option to copy over while publishing the toolbox.

Anyway, I can copy the files over myself to the server I guess.
0 Kudos
ShingLin
Esri Contributor
There are several ways you can do this without manually copying your script files to the server.

1. You can copy all the python files you wrote and saved under the same folder of the python file you are publishing.
2. You can save all the python files you wrote under the the folder where you specify the system variable PYTHONPATH.
3. You can hard-code the path of the folder that contains all the files you wrote, then use sys.path.append to append the folder in the publishing script.
0 Kudos