PieroMacaluso / dummy-env

1 stars 1 forks source link

How to solve # ERROR: AssertionError: Your environment must inherit from the gym.Env class cf https://github.com/openai/gym/blob/master/gym/core.py? #1

Open tianyu-z opened 1 year ago

tianyu-z commented 1 year ago

Hello, I encounter the same issue you mentioned in line 18 in the main_dummy.py (# ERROR: AssertionError: Your environment must inherit from the gym.Env class cf https://github.com/openai/gym/blob/master/gym/core.py). How did you fix it? Thanks!

tianyu-z commented 1 year ago

Even if I comment that line out, I get another issue: AttributeError: 'parallel_env' object has no attribute 'render_mode' in the line 21. (model = PPO("MlpPolicy", env_parallel, verbose=1)). Did you happened to encounter this one?

tianyu-z commented 1 year ago

One more thing that I would like to point out is that I cannot install the requirements.txt without encounter confliction. The detailed confliction lies in: stable-baselines3 @ git+https://github.com/carlosluis/stable-baselines3.git@fix_tests is adapted to gym==0.26.2 and importlib-metadata==4.13.0 rather than gym==0.25.0 and importlib-metadata==4.12.0 which is in the requirements.txt.

The messages:

The conflict is caused by: The user requested gym==0.25.0 pettingzoo 1.19.0 depends on gym>=0.21.0 supersuit 3.5.0 depends on gym>=0.24.1 stable-baselines3 2.0.0a0 depends on gym==0.26.2

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict

Is there any recommendation from your side? Thanks!