From the error message, the problem is that you do not have pygame version 2 or above. The pygame.SCALED flag is something that was not in previous pygame versions.