I have two parts with their own requirements.txt files. These files have some packages in common. When I run 'snapcraft' command, it complains - 'Parts one and two have the following file paths in common which have different contents'. How can I install both parts with their own requirement.txt in the same snap?
You can filter files out of the stage directory, like this:
Probably, you need to chose the files from one of the parts that will end up in the snap, and filter out the duplicates from the other part.
You can read more about limiting the number of installed files here: https://docs.snapcraft.io/build-snaps/advanced-features#limiting-the-number-of-installed-files