I have an ArcGIS geoprocessing service which causes problems when publishing to arcgis server. The python scripts behind the service are structured as a custom python module, in a folder with an 'init.py' file, because the scripts contain many thousands of lines of code and there was a design choice to develop this way. My problem is that the script 'main.py' is published to the server correctly, but all of the other scripts are not. 'main.py' calls all of the other scripts. Therefore when I try to run the service I get ' Import Error - No such module as Scriptsforservice', where main.py is importing.

Is there a way to get arcgis to upload the custom module properly during publishing? I have found a hack which is to copy the module directly into my server's local python libraries, but this is not an acceptable long term solution.

  • 1
    Have you seen this help topic: resources.arcgis.com/en/help/main/10.2/#/… Specifically these sections "Importing other Python modules" and "Making project data and modules tool parameters" – KHibma Feb 18 '14 at 14:50
  • I think we would need to see some working code snippets that illustrate your coding pattern and where you are stuck before this can become answerable. – PolyGeo Feb 22 '15 at 12:27