Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__init__.py error #49

Open
dkssud715 opened this issue May 21, 2023 · 4 comments
Open

__init__.py error #49

dkssud715 opened this issue May 21, 2023 · 4 comments

Comments

@dkssud715
Copy link

/content/ma-gym/ma_gym/init.py in
8 # Register openai's environments as multi agent
9 # This should be done before registering new environments
---> 10 env_specs = [env_spec for env_spec in envs.registry.all() if 'gym.envs' in env_spec.entry_point]
11 for spec in env_specs:
12 register(

AttributeError: 'dict' object has no attribute 'all'

@koulanurag
Copy link
Owner

koulanurag commented May 21, 2023

Can you share your ma-gym installation steps? Also, I would recommend to re-try in a virtualenv.

This colab link may help you.

@370025263
Copy link

370025263 commented Aug 31, 2023

same issue with me.

MY ENV INFO:

(pytorch_env) [root@worker01 MARL]# python version.py 
/root/anaconda3/envs/pytorch_env/lib/python3.6/site-packages/gym/core.py:27: UserWarning: WARN: Gym minimally supports python 3.6 as the python foundation not longer supports the version, please update your version to 3.7+
  "Gym minimally supports python 3.6 as the python foundation not longer supports the version, please update your version to 3.7+"
Python版本: 3.6.12 |Anaconda, Inc.| (default, Sep  8 2020, 23:10:56) 
[GCC 7.3.0]
pip版本: 20.2.4
setuptools版本: 50.3.0.post20201006
wheel版本: 0.35.1
gym版本: 0.26.2

REQUIREMENTS:

 pip install 'pip<=23.0.1'
 pip install 'setuptools<=66'
 pip install 'wheel<=0.38.4'

it seems that everything is satisfied.

@370025263
Copy link

370025263 commented Aug 31, 2023

the problem solved after i changed from gym 0.26 to gym 0.18.3
pip install gym==0.18.3
everthing works fine and the problem no longer appears.

the problem originates from the "pip install -e ." command that will install the newest version of gym, which changed a lot of default apis.

GPT answer:

According to the reference you provided, ma-gym is a collection of multi-agent environments based on OpenAI Gym. It was published in 2019.

Since 2019, OpenAI Gym has released several versions. The latest stable version as of my knowledge cutoff date is gym 0.18.3. Therefore, it would be appropriate to install gym version 0.18.3.

You can install gym version 0.18.3 using the following command:

pip install gym==0.18.3

This will ensure that the gym version you install is compatible with ma-gym. Please note that if you use a newer version of gym, there may be compatibility issues with ma-gym.

@koulanurag
Copy link
Owner

koulanurag commented Aug 31, 2023

Thanks for bringing this to my notice.

Your previous gym version( 0.26.2) is not supported by ma-gym. It will be helpful if you can share your ma-gym installation steps as it will install gym>=0.19.0,<=0.20.0 . This can be found in setup.py file.

Even though gym==0.18.3 seems to work; I would recommend upgrading gym to above requirements or doing a fresh installation in a new virtual environment using following commands

pip install --root-user-action=ignore 'pip<=23.0.1'
pip install --root-user-action=ignore 'setuptools<=66'
pip install --root-user-action=ignore 'wheel<=0.38.4'
pip install --root-user-action=ignore ma-gym

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants