generalize exception handling for memory dump and fix requirements.txt