How to solve "PYTHIA Abort from Pythia::Pythia: unmatched version numbers :"

Created by Olivier Mattelaer
Keywords:

If you face an error similar to
 PYTHIA Abort from Pythia::Pythia: unmatched version numbers : in code 8.306 but in XML 8.240
within the file
tag_1_pythia8.log

This typically means that you have multiple version of pythia8 install and that the system try to run one but is linking some meta-data from the second one. The solution is typically to change the following environment variable " PYTHIA8DATA"

for example via the following command:
export PYTHIA8DATA="MG5_dir/HEPTools/pythia8/share/Pythia8/xmldoc"

(modify MG5_dir in the above command to the actual path of MG5aMC)