from gym import envs all_envs = envs.registry.all() env_ids = [env_spec.id for env_spec in all_envs] print(env_ids)

Read more of this post