MAgent2 icon indicating copy to clipboard operation
MAgent2 copied to clipboard

ModuleNotFoundError: No module named 'magent2.environments'

Open Carton9 opened this issue 3 years ago • 4 comments

I install the magent2 by command pip install magent2 and try to run the demon code. Yet it shows following error.

Traceback (most recent call last): File "****\test.py", line 1, in <module> from magent2.environments import battle_v4 ModuleNotFoundError: No module named 'magent2.environments'

Carton9 avatar Mar 03 '23 20:03 Carton9

same problem

zzhixin avatar Mar 04 '23 03:03 zzhixin

I have the same problem. It must be something with the installer, since after installing there are only two files in the site-packages directory: libmagent.so and testlib. There is no init file and it seems all relevant code is missing. Also, on a different but related note: the example code heavily uses the pettingzoo lib, but there is no requirement for it (not in the toml file, not in requirements nor in setup).

Arosseau avatar Mar 09 '23 22:03 Arosseau

same problem

anthony0727 avatar Mar 12 '23 08:03 anthony0727

Solution that worked for me (credit to Carton9): After you run command pip install magent2, you need to download MAgent2/magent2/* and add all those files into your python library folder.

scottmayberry avatar Mar 13 '23 02:03 scottmayberry

Hello!

New Patch v0.3.3 was recently released to resolve this this issue thus no longer requires the workaround mentioned by @scottmayberry via @Carton9. Please open a new issue if any other issues are encountered after installing the updated version via pip install. This fix should allow the use of the library both locally and in a collaborative environment like Google Collab.

atstarke avatar Aug 23 '24 15:08 atstarke