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

Error when install magent2 in anaconda env on window #53

Open
sambt22022517 opened this issue Nov 25, 2024 · 0 comments
Open

Error when install magent2 in anaconda env on window #53

sambt22022517 opened this issue Nov 25, 2024 · 0 comments

Comments

@sambt22022517
Copy link

I'm using window 10 and I got error while installing magent2.
When i use pip install magent2, it's ok but when i using it, an error occurs:

Traceback (most recent call last):
  File "e:\Subject\University\RL\Project\RL-final-project-AIT-3007\main.py", line 14, in <module>
    env.reset()
  File "e:\Subject\University\RL\Project\RL-final-project-AIT-3007\.conda\lib\site-packages\pettingzoo\utils\wrappers\order_enforcing.py", line 118, in reset
    super().reset(seed=seed, options=options)
  File "e:\Subject\University\RL\Project\RL-final-project-AIT-3007\.conda\lib\site-packages\pettingzoo\utils\wrappers\base.py", line 38, in reset
    self.env.reset(seed=seed, options=options)
  File "e:\Subject\University\RL\Project\RL-final-project-AIT-3007\.conda\lib\site-packages\pettingzoo\utils\wrappers\base.py", line 38, in reset
    self.env.reset(seed=seed, options=options)
  File "e:\Subject\University\RL\Project\RL-final-project-AIT-3007\.conda\lib\site-packages\pettingzoo\utils\conversions.py", line 306, in reset
    self._observations, self.infos = self.env.reset(seed=seed, options=options)
ValueError: too many values to unpack (expected 2)

Then i try another installing way pip install git+https://github.com/Farama-Foundation/MAgent2 but this can not install magent2 for my env cuz this error:

Collecting git+https://github.com/Farama-Foundation/MAgent2
  Cloning https://github.com/Farama-Foundation/MAgent2 to c:\users\buisa\appdata\local\temp\pip-req-build-u37068_q
  Running command git clone --filter=blob:none --quiet https://github.com/Farama-Foundation/MAgent2 'C:\Users\buisa\AppData\Local\Temp\pip-req-build-u37068_q'
  Resolved https://github.com/Farama-Foundation/MAgent2 to commit b2ddd49445368cf85d4d4e1edcddae2e28aa1406
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting numpy<2.0,>=1.21.0 (from magent2==0.3.3)
  Using cached numpy-1.26.4-cp310-cp310-win_amd64.whl.metadata (61 kB)
Collecting pygame>=2.1.0 (from magent2==0.3.3)
  Using cached pygame-2.6.1-cp310-cp310-win_amd64.whl.metadata (13 kB)
Collecting pettingzoo>=1.23.1 (from magent2==0.3.3)
  Using cached pettingzoo-1.24.3-py3-none-any.whl.metadata (8.5 kB)
Collecting gymnasium>=0.28.0 (from pettingzoo>=1.23.1->magent2==0.3.3)
  Using cached gymnasium-1.0.0-py3-none-any.whl.metadata (9.5 kB)
Collecting cloudpickle>=1.2.0 (from gymnasium>=0.28.0->pettingzoo>=1.23.1->magent2==0.3.3)
  Using cached cloudpickle-3.1.0-py3-none-any.whl.metadata (7.0 kB)
Collecting typing-extensions>=4.3.0 (from gymnasium>=0.28.0->pettingzoo>=1.23.1->magent2==0.3.3)
  Using cached typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB)
Collecting farama-notifications>=0.0.1 (from gymnasium>=0.28.0->pettingzoo>=1.23.1->magent2==0.3.3)
  Using cached Farama_Notifications-0.0.4-py3-none-any.whl.metadata (558 bytes)
Using cached numpy-1.26.4-cp310-cp310-win_amd64.whl (15.8 MB)
Using cached pettingzoo-1.24.3-py3-none-any.whl (847 kB)
Using cached pygame-2.6.1-cp310-cp310-win_amd64.whl (10.6 MB)
Using cached gymnasium-1.0.0-py3-none-any.whl (958 kB)
Using cached cloudpickle-3.1.0-py3-none-any.whl (22 kB)
Using cached Farama_Notifications-0.0.4-py3-none-any.whl (2.5 kB)
Using cached typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Building wheels for collected packages: magent2
  Building wheel for magent2 (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for magent2 (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [134 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build\lib.win-amd64-cpython-310\magent2
      copying magent2\c_lib.py -> build\lib.win-amd64-cpython-310\magent2
      copying magent2\environment.py -> build\lib.win-amd64-cpython-310\magent2
      copying magent2\gridworld.py -> build\lib.win-amd64-cpython-310\magent2
      copying magent2\render.py -> build\lib.win-amd64-cpython-310\magent2
      copying magent2\utility.py -> build\lib.win-amd64-cpython-310\magent2
      copying magent2\__init__.py -> build\lib.win-amd64-cpython-310\magent2
      creating build\lib.win-amd64-cpython-310\magent2\builtin
      copying magent2\builtin\__init__.py -> build\lib.win-amd64-cpython-310\magent2\builtin
      creating build\lib.win-amd64-cpython-310\magent2\environments
      copying magent2\environments\adversarial_pursuit_v4.py -> build\lib.win-amd64-cpython-310\magent2\environments
      copying magent2\environments\battlefield_v5.py -> build\lib.win-amd64-cpython-310\magent2\environments
      copying magent2\environments\battle_v4.py -> build\lib.win-amd64-cpython-310\magent2\environments
      copying magent2\environments\combined_arms_v6.py -> build\lib.win-amd64-cpython-310\magent2\environments
      copying magent2\environments\gather_v5.py -> build\lib.win-amd64-cpython-310\magent2\environments
      copying magent2\environments\magent_env.py -> build\lib.win-amd64-cpython-310\magent2\environments
      copying magent2\environments\tiger_deer_v4.py -> build\lib.win-amd64-cpython-310\magent2\environments
      copying magent2\environments\__init__.py -> build\lib.win-amd64-cpython-310\magent2\environments
      creating build\lib.win-amd64-cpython-310\magent2\builtin\config
      copying magent2\builtin\config\battle.py -> build\lib.win-amd64-cpython-310\magent2\builtin\config
      copying magent2\builtin\config\double_attack.py -> build\lib.win-amd64-cpython-310\magent2\builtin\config
      copying magent2\builtin\config\forest.py -> build\lib.win-amd64-cpython-310\magent2\builtin\config
      copying magent2\builtin\config\pursuit.py -> build\lib.win-amd64-cpython-310\magent2\builtin\config
      copying magent2\builtin\config\__init__.py -> build\lib.win-amd64-cpython-310\magent2\builtin\config
      creating build\lib.win-amd64-cpython-310\magent2\environments\adversarial_pursuit
      copying magent2\environments\adversarial_pursuit\adversarial_pursuit.py -> build\lib.win-amd64-cpython-310\magent2\environments\adversarial_pursuit
      copying magent2\environments\adversarial_pursuit\__init__.py -> build\lib.win-amd64-cpython-310\magent2\environments\adversarial_pursuit
      creating build\lib.win-amd64-cpython-310\magent2\environments\battle
      copying magent2\environments\battle\battle.py -> build\lib.win-amd64-cpython-310\magent2\environments\battle
      copying magent2\environments\battle\__init__.py -> build\lib.win-amd64-cpython-310\magent2\environments\battle
      creating build\lib.win-amd64-cpython-310\magent2\environments\battlefield
      copying magent2\environments\battlefield\battlefield.py -> build\lib.win-amd64-cpython-310\magent2\environments\battlefield
      copying magent2\environments\battlefield\__init__.py -> build\lib.win-amd64-cpython-310\magent2\environments\battlefield
      creating build\lib.win-amd64-cpython-310\magent2\environments\combined_arms
      copying magent2\environments\combined_arms\combined_arms.py -> build\lib.win-amd64-cpython-310\magent2\environments\combined_arms
      copying magent2\environments\combined_arms\__init__.py -> build\lib.win-amd64-cpython-310\magent2\environments\combined_arms
      creating build\lib.win-amd64-cpython-310\magent2\environments\gather
      copying magent2\environments\gather\gather.py -> build\lib.win-amd64-cpython-310\magent2\environments\gather
      copying magent2\environments\gather\__init__.py -> build\lib.win-amd64-cpython-310\magent2\environments\gather
      creating build\lib.win-amd64-cpython-310\magent2\environments\tiger_deer
      copying magent2\environments\tiger_deer\tiger_deer.py -> build\lib.win-amd64-cpython-310\magent2\environments\tiger_deer
      copying magent2\environments\tiger_deer\__init__.py -> build\lib.win-amd64-cpython-310\magent2\environments\tiger_deer
      running egg_info
      writing magent2.egg-info\PKG-INFO
      writing dependency_links to magent2.egg-info\dependency_links.txt
      writing requirements to magent2.egg-info\requires.txt
      writing top-level names to magent2.egg-info\top_level.txt
      reading manifest file 'magent2.egg-info\SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no files found matching '*' under directory 'magent2\config'
      warning: no files found matching '*' under directory 'magent2\scenarios'
      warning: no files found matching '*.dylib'
      warning: no files found matching '*.dll'
      warning: no files found matching '*.so'
      adding license file 'LICENSE'
      writing manifest file 'magent2.egg-info\SOURCES.txt'
      copying magent2\environments\adversarial_pursuit_v4.py -> build\lib.win-amd64-cpython-310\magent2\environments
      copying magent2\environments\battlefield_v5.py -> build\lib.win-amd64-cpython-310\magent2\environments
      copying magent2\environments\battle_v4.py -> build\lib.win-amd64-cpython-310\magent2\environments
      copying magent2\environments\combined_arms_v6.py -> build\lib.win-amd64-cpython-310\magent2\environments
      copying magent2\environments\gather_v5.py -> build\lib.win-amd64-cpython-310\magent2\environments
      copying magent2\environments\magent_env.py -> build\lib.win-amd64-cpython-310\magent2\environments
      copying magent2\environments\tiger_deer_v4.py -> build\lib.win-amd64-cpython-310\magent2\environments
      copying magent2\environments\__init__.py -> build\lib.win-amd64-cpython-310\magent2\environments
      running build_ext
      -- Building for: NMake Makefiles
      CMake Error at CMakeLists.txt:3 (project):
        Running
     
         'nmake' '-?'
     
        failed with:
     
         no such file or directory
     
     
      CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
      CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
      -- Configuring incomplete, errors occurred!
      Traceback (most recent call last):
        File "C:\Users\buisa\miniconda3\envs\rl-env2\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\buisa\miniconda3\envs\rl-env2\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "C:\Users\buisa\miniconda3\envs\rl-env2\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\build_meta.py", line 438, in build_wheel
          return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\build_meta.py", line 426, in _build
          return self._build_with_temp_dir(
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\build_meta.py", line 407, in _build_with_temp_dir
          self.run_setup()
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 115, in <module>
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 183, in setup
          return run_commands(dist)
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 199, in run_commands
          dist.run_commands()
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 954, in run_commands
          self.run_command(cmd)
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\dist.py", line 995, in run_command
          super().run_command(command)
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command
          cmd_obj.run()
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\command\bdist_wheel.py", line 381, in run
          self.run_command("build")
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\dist.py", line 995, in run_command
          super().run_command(command)
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command
          cmd_obj.run()
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 135, in run
          self.run_command(cmd_name)
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\dist.py", line 995, in run_command
          super().run_command(command)
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command
          cmd_obj.run()
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\command\build_ext.py", line 99, in run
          _build_ext.run(self)
        File "C:\Users\buisa\AppData\Local\Temp\pip-build-env-19nnfolb\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 359, in run
          self.build_extensions()
        File "<string>", line 65, in build_extensions
        File "C:\Users\buisa\miniconda3\envs\rl-env2\lib\subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\buisa\\AppData\\Local\\Temp\\pip-req-build-u37068_q', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\buisa\\AppData\\Local\\Temp\\pip-req-build-u37068_q\\build\\lib.win-amd64-cpython-310\\magent2', '-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\buisa\\AppData\\Local\\Temp\\pip-req-build-u37068_q\\build\\lib.win-amd64-cpython-310\\magent2', '-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=build\\temp.win-amd64-cpython-310\\Release']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for magent2
Failed to build magent2
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (magent2)

Can anyone help ?

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

1 participant