robotology-legacy / gym-ignition

Framework for developing OpenAI Gym robotics environments simulated with Ignition Gazebo
https://robotology.github.io/gym-ignition
GNU Lesser General Public License v3.0
231 stars 26 forks source link

Runtime problem when running with gym >= 0.22 #427

Open traversaro opened 2 years ago

traversaro commented 2 years ago

@RiccardoZuppetti experienced this error:

Original exception was:
Traceback (most recent call last):
  File "retargeting.py", line 9, in <module>
    from gym_ignition.utils.scenario import init_gazebo_sim
  File "/usr/local/lib/python3.8/dist-packages/gym_ignition/__init__.py", line 14, in <module>
    resource_finder.add_path_from_env_var("IGN_GAZEBO_RESOURCE_PATH")
  File "/usr/local/lib/python3.8/dist-packages/gym_ignition/utils/resource_finder.py", line 50, in add_path_from_env_var
    add_path(path)
  File "/usr/local/lib/python3.8/dist-packages/gym_ignition/utils/resource_finder.py", line 20, in add_path
    logger.warn(f"The path '{data_path}' does not exist. Not added to the data path.")
  File "/usr/local/lib/python3.8/dist-packages/gym_ignition/utils/logger.py", line 31, in warn
    if logger.MIN_LEVEL <= logger.WARN:
AttributeError: module 'gym.logger' has no attribute 'MIN_LEVEL'

@diegoferigo reported that:

It seems that one of the new versions of openai/gym includes openai/gym#2477 that changes the name of this logging variable, breaking our downstream logic. Just to double check, try to update your line 31 of /usr/local/lib/python3.8/dist-packages/gym_ignition/utils/logger.py to use min_level instead of MIN_LEVEL.