Store Relative Path to Custom Script GP Tool in Pro Task

679
3
03-31-2022 12:13 PM
Labels (2)
MikeLachance1
New Contributor III

I have created some custom Python scripts that I have saved as GP tools in a custom toolbox. I have created Tasks that run these scripts.

When I package up my Pro project and send it to another user, the user gets an error when running the task saying that the GP tool (script) can't be found. The error message references the path on my hard drive where the script / tool box was. The script tools themselves are in the user's project (since they were a part of the package) and these script tools run fine for the user. The issue is that the Task does not seem to recognize the scripts within the project.

 

How can I force the task to reference the scripts within the project and not a hard path on my hard drive? This packaged project will be distributed to many users and they will all extract it to their own computers. I need the project, tasks, and scripts to all work when they unpack the project on their own machines.

0 Kudos
3 Replies
Robert_LeClair
Esri Notable Contributor

MIke - I wonder if you use the Consolidate Project GP tool first with the "Share outside of the organization (optional)" parameter unchecked.  Then open the new *.aprx and use the Project Package to create the new *.ppkx.  What is the result?

0 Kudos
MikeLachance1
New Contributor III

Hi Robert,

Thanks for the suggestion. After Consolidating the project and then packaging it up again, it is still referencing the original project and toolbox file at the location on my hard drive.

0 Kudos
AnnaWegbreitBR
New Contributor

I am interested in a similar workflow so I'd like to know if its possible to include custom Python tools in a ArcGIS Pro Task and be able to package and share it like other Tasks. I haven't been able to find many resources about including custom GP tools in Tasks. 

0 Kudos