pycharm:gym.error.DeprecatedEnv: Env Pendulum-v0 not found (valid versions include [‘Pendulum-v1‘])

created at 12-05-2021 views: 2

problem

When using the gym package, I encountered the following problem: I couldn't find the corresponding version.

 for external in metadata.entry_points().get(self.group, []):
Traceback (most recent call last):
  File "E:\Soft\miniconda\envs\py\lib\site-packages\gym\envs\registration.py", line 158, in spec
    return self.env_specs[id]
KeyError: 'Pendulum-v0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:/Papers/202111/tianshou-0.4.4/test/continuous/test_ppo.py", line 191, in <module>
    test_ppo()
  File "E:/Papers/202111/tianshou-0.4.4/test/continuous/test_ppo.py", line 58, in test_ppo
    env = gym.make(args.task)
  File "E:\Soft\miniconda\envs\py\lib\site-packages\gym\envs\registration.py", line 235, in make
    return registry.make(id, **kwargs)
  File "E:\Soft\miniconda\envs\py\lib\site-packages\gym\envs\registration.py", line 128, in make
    spec = self.spec(path)
  File "E:\Soft\miniconda\envs\py\lib\site-packages\gym\envs\registration.py", line 187, in spec
    id, matching_envs
gym.error.DeprecatedEnv: Env Pendulum-v0 not found (valid versions include ['Pendulum-v1'])

Process finished with exit code 1

solution

The task of running CartPole-v0 can be run before, so it means that there is no problem with my gym. Just change Pendulum-v0 to Pendulum-v1 and it will run (the problem is mainly about the version)

created at:12-05-2021
edited at: 12-05-2021: