Use shutil.which instead of the which command