If the directory is read-only, use the systems tmp directory for generated py files.