Select to view content in your preferred language

Is it possible to include dependenices in a custom geoprocessing tool?

85
3
Jump to solution
yesterday
mfcallahan
Frequent Contributor

I would like to publish a tool which has a dependency on the ArcGIS Large Network Analysis Tools. I can import this toolbox and use within a standalone script, but I'm wondering if I can ship these files along with my tool when publishing as a geoprocessing tool to ArcGIS Enterprise.

1 Solution

Accepted Solutions
HaydenWelch
MVP Regular Contributor

Sadly extensions that require a license need the license to be available in whatever environment the tool is being interpreted in. You could do what I do and implement the Network logic on your own and then ship that. You can use da.SearchCursors, da.UpdateCursors, and Networxx to replace the licensed code in that large-network-analysis tool.

The big issue is that the Network tools tend to make calls to ESRI servers and require tokens to run.

If the server you're running your code on has no Pro license, you can't run arcpy either, it patches directly into the Pro binaries to run, and without a valid ArcGIS Pro binary available, it won't work.

I believe that running it on an Enterprise server will work as those ship with the runtime.

View solution in original post

3 Replies
HaydenWelch
MVP Regular Contributor

You can publish it, but whoever runs it needs the Network Analyst license to run your tool.  You can run a license check at the top of your toolbox:

if not arcpy.CheckExtension('Network') == 'Available':
    raise ImportError('Network Analyst extension required to run this tool')
mfcallahan
Frequent Contributor

Oof, that's a bummer, it sounds like what I was looking to do may not be possible. I was hoping to publish a tool which could be called from a standalone script I have running as a scheduled task on a server. The script periodically fetches data from a few different sources and updates a table, and one of the columns in that table contains a value derived from the output of the large network analysis. The server to which my scheduled task is deployed does not have ArcGIS Pro and does not have any individual ArcGIS Pro users. Is such a scenario just not possible?

HaydenWelch
MVP Regular Contributor

Sadly extensions that require a license need the license to be available in whatever environment the tool is being interpreted in. You could do what I do and implement the Network logic on your own and then ship that. You can use da.SearchCursors, da.UpdateCursors, and Networxx to replace the licensed code in that large-network-analysis tool.

The big issue is that the Network tools tend to make calls to ESRI servers and require tokens to run.

If the server you're running your code on has no Pro license, you can't run arcpy either, it patches directly into the Pro binaries to run, and without a valid ArcGIS Pro binary available, it won't work.

I believe that running it on an Enterprise server will work as those ship with the runtime.