Farama-Foundation / SuperSuit

A collection of wrappers for Gymnasium and PettingZoo environments (being merged into gymnasium.wrappers and pettingzoo.wrappers
Other
452 stars 57 forks source link

Import naming issue (supersuit=3.3.3 pettingzoo==1.15.0) #132

Closed hvpeteet closed 2 years ago

hvpeteet commented 2 years ago

TLDR: cannot import name 'aec_to_parallel' (supersuit=3.3.3 pettingzoo==1.15.0) due to renamed functions in pettingzoo

Repro:

pip install pettingzoo==1.14.0
pip install supersuit==3.3.3
from supersuit.utils.wrapper_chooser import WrapperChooser
-ImportError: cannot import name 'aec_to_parallel' from 'pettingzoo.utils.conversions'

The bug:

  1. pettingzoo 1.15.0 changed the name of 2 functions to_parallel and from_parallel to aec_to_parallel and aec_from_parallel https://github.com/Farama-Foundation/PettingZoo/releases/tag/1.15.0
  2. supersuit 3.3.3 picked up this change and changed their imports https://github.com/Farama-Foundation/SuperSuit/blob/2f31857463843467a98783ced83194b66dbd7059/supersuit/utils/wrapper_chooser.py#L3
  3. supersuit 3.3.3 didn't update their min version of pettingzoo https://github.com/Farama-Foundation/SuperSuit/blob/2f31857463843467a98783ced83194b66dbd7059/setup.py#L30

Consequence: when running pettingzoo < 1.15.0 and supersuit > 3.3.3 you can get an import error when using WrapperChooser or anything that depends on it (action_lambda, etc...)

Possible fixes (not sure what y'all would prefer)

benblack769 commented 2 years ago

I'm sorry to hear you ran into this issue. I think we would prefer to just fix the minimum version of pettingzoo in supersuit. Pettingzoo and supersuit are very closely tied libraries and often have concurrent release dates, so it makes sense for supersuit releases to have pretty strict dependencies on pettingzoo versions.

In the meantime, I would try to use the latest versions of both packages whenever possible. If there is some issue preventing you from using the latest versions of both packages, please let us know.

jkterry1 commented 2 years ago

Hey, I'm closing this due to inactivity, please let us know if you have any questions