Hi all,
This post is a workaround for people who receives the message (Dataset not found message) when running Arcpro Project Packaging Tool.
Dataset not found message
arcpy.management.PackageProject(in_project, output_file)
It seems as though even if you exclude toolboxes from the package, Pro will still attempt to process them.
I had a project where I'd verified every data source yet still produced the 'database not found' error. Attempting to share the project package as a template threw up a new set of errors showing that it had found invalid data sources in some temporary models in my default toolbox. I had to delete all the models which didn't work anymore to get it to package properly.
Esri, please exclude toolboxes from the packaging process if the option is selected.
Thank you for this suggestion! Worked great for me when I deleted the model in my toolbox.
This worked well, although the toolbox in question had tools in it that I needed to keep. My parallel approach was to create a new empty toolbox in the home folder, then I added that empty toolbox to the project, set the empty toolbox as the default toolbox, and finally removed the 'offending' toolbox. After that, the project packaged successfully! Thanks for the recommendation Richard!
After a few tries I did get this method to work. But I'm going to post exactly what I did to hopefully help neophytes like me who need all the steps.
In ArcGIS Pro, I went to the Analysis tab and clicked "Python" in the Geoprocessing section.
In the New Notebook that opened, I entered the following bold text, specific names are in brackets and should be replaced and brackets removed.
import arcpy
in_project = "[project name].aprx"
output_file = "[output file path, with forward slashes, e.g. C:/ArcGIS Projects/etc].ppkx"
arcpy.management.PackageProject(in_project, output_file)
Then I hit "run" and it gave a very helpful set of error messages after it finished.
Like others, it was custom tools (which I told it to exclude) that were the problem.
Hi,
I had the same "Dataset not found message" when I used the standard tool for creating project packages.
Then I tried the Tool "Package Project" from the Data Management Toolbox (https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/package-project.htm) with some more options. Here I got the same message, but with a with a specific reference to the Problem. It was a csv-File loeded to a map and renamed afterwards. Just deleted the csv from my project and this tool worked fine.
Thanks so much for this! I kept getting the "Dataset not found" error, and I had checked all my file paths and everything I could think of but wasn't getting anywhere.
I ran the arcpy (Thanks also to Sarah_W for the detailed instructions in the comments, which were very helpful for me as I hadn't used the python window before).
I ended up getting more details, specifically this error:
ExecuteError: ERROR 000210: Cannot create output C:\files...ProjectPackage. Failed to execute (PackageProject).
I had been using UNC paths to access the data, so I swapped that for a locally mapped drive instead, and ran it again.
Then I got this error:
ExecuteError: ERROR 001795: Failed to consolidate project due to problem with Geoprocessing History item: Package Project.
So I opened the Geoprocessing History (Analysis Tab > Geoprocessing section > History) and I deleted all of my previously failed project package attempts, plus, just in case, I deleted all the other items (feature class to feature class, regular old geoprocessing tasks that had worked) to completely clear it out. After that, I ran the arcpy again and it completed successfully!
update: I'm still struggling with this. Although the Python ran successfully and output a .ppkx file, after the contractor opened it, it turned out that file didn't include all the data.
I tried running Export to Map Package instead, but that also fails. I can't win here.
I'm having a similar issue with a dataset not found error when sharing to a portal but I have no idea where this reference is. Just checking for your error, did you select the option 'share outside organisation' as that is meant to save any data that you are linked to in the package.
Yes, I did select 'share outside organization' and it still didn't work for me. 😞