Giter VIP home page Giter VIP logo

Comments (5)

elliottower avatar elliottower commented on May 30, 2024 3

python3 setup.py install

Sorry for the delay on this issue, but I think this is now fixed. Editable mode (pip install -e .) still has some issues due to CMake which I'm not well versed enough to be able to fix, but running python3 setup.py install should work now. Installing locally via pip install . also works.

If you are interested in helping out further we would love to have extra hands helping with making proper testing to ensure things like this work (on other farama projects our CI installs on different python versions on linux and mac osx to ensure things work as intended). This project doesn't currently have any testing through pytest either, but that requires domain knowledge of the library, which I unfortunately do not have, and the other previous maintainers haven't had much time to get around to it.

from magent2.

QuiZet avatar QuiZet commented on May 30, 2024

I am getting the same issue on linux with pip install magent2 command
pip version: 23.1.2
linux version: Ubuntu 20.04.4 LTS

Collecting magent2
  Using cached magent2-0.3.2.tar.gz (4.1 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [19 lines of output]
      Traceback (most recent call last):
        File "/home/yungisimon/anaconda3/envs/Farama_Hetero/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/yungisimon/anaconda3/envs/Farama_Hetero/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/yungisimon/anaconda3/envs/Farama_Hetero/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-ycn_xn10/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-ycn_xn10/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-ycn_xn10/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 116, in <module>
        File "<string>", line 21, in get_version
      FileNotFoundError: [Errno 2] No such file or directory: 'magent2/__init__.py'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

from magent2.

QuiZet avatar QuiZet commented on May 30, 2024

failed to compile from source, with python3 setup.py install as well.

from magent2.

ChenJiangxi avatar ChenJiangxi commented on May 30, 2024

python3 setup.py install

Sorry for the delay on this issue, but I think this is now fixed. Editable mode (pip install -e .) still has some issues due to CMake which I'm not well versed enough to be able to fix, but running python3 setup.py install should work now. Installing locally via pip install . also works.

If you are interested in helping out further we would love to have extra hands helping with making proper testing to ensure things like this work (on other farama projects our CI installs on different python versions on linux and mac osx to ensure things work as intended). This project doesn't currently have any testing through pytest either, but that requires domain knowledge of the library, which I unfortunately do not have, and the other previous maintainers haven't had much time to get around to it.

I installed successfully using pip install ., but still got the following error message when executing from magent2.environments import battle_v4:

from magent2.environments import battle_v4
Traceback (most recent call last):
File "", line 1, in
File "/Users/xxx/CodeProject/MARL/MAgent2/magent2/init.py", line 1, in
from magent2 import gridworld, utility
File "/Users/xxx/CodeProject/MARL/MAgent2/magent2/gridworld.py", line 10, in
from magent2.c_lib import _LIB, as_float_c_array, as_int32_c_array
File "/Users/xxx/CodeProject/MARL/MAgent2/magent2/c_lib.py", line 43, in
_LIB = _load_lib()
File "/Users/xxx/CodeProject/MARL/MAgent2/magent2/c_lib.py", line 22, in _load_lib
lib = ctypes.CDLL(path_to_so_file, ctypes.RTLD_GLOBAL)
File "/Users/xxx/anaconda3/envs/marl/lib/python3.8/ctypes/init.py", line 373, in init
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/xxx/CodeProject/MARL/MAgent2/magent2/libmagent.dylib, 0x000A): tried: '/Users/xxx/CodeProject/MARL/MAgent2/magent2/libmagent.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/xxx/CodeProject/MARL/MAgent2/magent2/libmagent.dylib' (no such file), '/Users/xxx/CodeProject/MARL/MAgent2/magent2/libmagent.dylib' (no such file)

I wonder if there are any solutions to this? thx.

from magent2.

elliottower avatar elliottower commented on May 30, 2024

Again I’m not a domain expert but it appears that the installation process involves copying the “libmagent” file in the build folder, explained here:

# move libmagent -> build/
and done for Linux here:
run: pip install . && ls -a && mv build/lib.linux-x86_64-3.9/magent2/libmagent.so magent2/libmagent.so

It seems that that libmagent file has a different extension (.so) on Linux and .dylib on MacOS, as seen here:

path_to_so_file = os.path.join(lib_path, "libmagent.dylib")

TLDR look for that file it says is missing, and copy it to the place where it is looking for it.

I think this should be something that can be fixed in the setup.py or elsewhere, but maybe it’s a manual process. I will leave fixing this to someone better versed in c++ as I am quite unfamiliar. FWIW the way I found those links above was just searching this repo for the file in the error, if in doubt you can usually figure things like that out in the same way yourself if someone like me isn’t able to respond quickly

from magent2.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.