You should only call check_python_libraries once. You can assign the return value into a list.