facebookresearch / nle

The NetHack Learning Environment
Other
937 stars 114 forks source link

Installing nle #338

Closed Arseni1919 closed 1 year ago

Arseni1919 commented 2 years ago

πŸ› Bug

For hours I try to understand what is going on.. Please help! How to install the nle stuff on Mac? This is my output in Terminal..

Try_OpenAI_GYM pip install minihack
Collecting minihack
  Using cached minihack-0.1.3-py3-none-any.whl
Requirement already satisfied: gym in /Users/perchik/opt/anaconda3/envs/Try_OpenAI_GYM/lib/python3.10/site-packages (from minihack) (0.25.2)
Collecting nle>=0.8.0
  Using cached nle-0.8.1.tar.gz (6.9 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.16 in /Users/perchik/opt/anaconda3/envs/Try_OpenAI_GYM/lib/python3.10/site-packages (from minihack) (1.23.2)
Collecting pybind11>=2.2
  Using cached pybind11-2.10.0-py3-none-any.whl (213 kB)
Requirement already satisfied: cloudpickle>=1.2.0 in /Users/perchik/opt/anaconda3/envs/Try_OpenAI_GYM/lib/python3.10/site-packages (from gym->minihack) (2.1.0)
Requirement already satisfied: gym-notices>=0.0.4 in /Users/perchik/opt/anaconda3/envs/Try_OpenAI_GYM/lib/python3.10/site-packages (from gym->minihack) (0.0.8)
Building wheels for collected packages: nle
  Building wheel for nle (pyproject.toml) ... error
  error: subprocess-exited-with-error

  Γ— Building wheel for nle (pyproject.toml) did not run successfully.
  β”‚ exit code: 1
  ╰─> [80 lines of output]
      fatal: not a git repository (or any of the parent directories): .git
      Building wheel nle-0.8.1
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-x86_64-cpython-310
      creating build/lib.macosx-10.9-x86_64-cpython-310/nle
      copying nle/version.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle
      copying nle/__init__.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle
      creating build/lib.macosx-10.9-x86_64-cpython-310/nle/env
      copying nle/env/tasks.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/env
      copying nle/env/__init__.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/env
      copying nle/env/base.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/env
      creating build/lib.macosx-10.9-x86_64-cpython-310/nle/nethack
      copying nle/nethack/actions.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/nethack
      copying nle/nethack/__init__.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/nethack
      copying nle/nethack/nethack.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/nethack
      creating build/lib.macosx-10.9-x86_64-cpython-310/nle/agent
      copying nle/agent/__init__.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/agent
      copying nle/agent/vtrace.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/agent
      copying nle/agent/agent.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/agent
      creating build/lib.macosx-10.9-x86_64-cpython-310/nle/scripts
      copying nle/scripts/read_heaplog.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/scripts
      copying nle/scripts/check_nethack_speed.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/scripts
      copying nle/scripts/plot.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/scripts
      copying nle/scripts/collect_env.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/scripts
      copying nle/scripts/__init__.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/scripts
      copying nle/scripts/play.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/scripts
      copying nle/scripts/ttyplay2.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/scripts
      copying nle/scripts/test_raw_nethack.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/scripts
      copying nle/scripts/read_tty.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/scripts
      copying nle/scripts/ttyrec.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/scripts
      copying nle/scripts/ttyplay.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/scripts
      creating build/lib.macosx-10.9-x86_64-cpython-310/nle/tests
      copying nle/tests/test_envs.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/tests
      copying nle/tests/test_nethack.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/tests
      copying nle/tests/test_profile.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/tests
      copying nle/tests/test_system.py -> build/lib.macosx-10.9-x86_64-cpython-310/nle/tests
      running build_ext
      -- The C compiler identification is Clang 13.0.0
      -- The CXX compiler identification is Clang 13.0.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - failed
      -- Check for working C compiler: /opt/homebrew/opt/llvm/bin/clang
      -- Check for working C compiler: /opt/homebrew/opt/llvm/bin/clang - broken
      CMake Error at /opt/homebrew/Cellar/cmake/3.24.1/share/cmake/Modules/CMakeTestCCompiler.cmake:69 (message):
        The C compiler

          "/opt/homebrew/opt/llvm/bin/clang"

        is not able to compile a simple test program.

        It fails with the following output:

          Change Dir: /private/var/folders/sd/9sq_fhy14jvdmsklx7t3snqw0000gn/T/pip-install-7fvfeu_8/nle_456c4aadce1945c6ad2ded589c4aaa2d/build/temp.macosx-10.9-x86_64-cpython-310/CMakeFiles/CMakeTmp

          Run Build Command(s):/usr/bin/make -f Makefile cmTC_01e12/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_01e12.dir/build.make CMakeFiles/cmTC_01e12.dir/build
          Building C object CMakeFiles/cmTC_01e12.dir/testCCompiler.c.o
          /opt/homebrew/opt/llvm/bin/clang   -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -MD -MT CMakeFiles/cmTC_01e12.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_01e12.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_01e12.dir/testCCompiler.c.o -c /private/var/folders/sd/9sq_fhy14jvdmsklx7t3snqw0000gn/T/pip-install-7fvfeu_8/nle_456c4aadce1945c6ad2ded589c4aaa2d/build/temp.macosx-10.9-x86_64-cpython-310/CMakeFiles/CMakeTmp/testCCompiler.c
          Linking C executable cmTC_01e12
          /opt/homebrew/Cellar/cmake/3.24.1/bin/cmake -E cmake_link_script CMakeFiles/cmTC_01e12.dir/link.txt --verbose=1
          /opt/homebrew/opt/llvm/bin/clang  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/homebrew/opt/llvm/lib  CMakeFiles/cmTC_01e12.dir/testCCompiler.c.o -o cmTC_01e12
          ld: in '/opt/homebrew/opt/llvm/lib/libunwind.dylib', building for macOS-x86_64 but attempting to link with file built for macOS-arm64
          clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
          make[1]: *** [cmTC_01e12] Error 1
          make: *** [cmTC_01e12/fast] Error 2

        CMake will not be able to correctly generate this project.
      Call Stack (most recent call first):
        CMakeLists.txt:3 (project)

      -- Configuring incomplete, errors occurred!
      See also "/private/var/folders/sd/9sq_fhy14jvdmsklx7t3snqw0000gn/T/pip-install-7fvfeu_8/nle_456c4aadce1945c6ad2ded589c4aaa2d/build/temp.macosx-10.9-x86_64-cpython-310/CMakeFiles/CMakeOutput.log".
      See also "/private/var/folders/sd/9sq_fhy14jvdmsklx7t3snqw0000gn/T/pip-install-7fvfeu_8/nle_456c4aadce1945c6ad2ded589c4aaa2d/build/temp.macosx-10.9-x86_64-cpython-310/CMakeFiles/CMakeError.log".
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for nle
Failed to build nle
ERROR: Could not build wheels for nle, which is required to install pyproject.toml-based projects
k24d commented 2 years ago
      ld: in '/opt/homebrew/opt/llvm/lib/libunwind.dylib', building for macOS-x86_64 but attempting to link with file built for macOS-arm64

It looks like your Homebrew installation is x86_64, while you are using an arm64 processor (maybe M1?).

Arseni1919 commented 2 years ago

yea, I use M1 macbook air. How can I reinstall Homebrew to a correct version? is that the main problem?..

k24d commented 2 years ago

Sorry, it seems you have a correct version. Homebrew supports M1 since February 2021 and installs the software under /opt/homebrew:

https://brew.sh/2021/02/05/homebrew-3.0.0/

So, why are you trying to build a x86_64 binary...? How did you install your Python? Is it x86_64 or arm64?

cdmatters commented 1 year ago

I was able to build on M1 mac with MacOS (13)

cuicui2023 commented 8 months ago

Where did you download minihack-0.1.3-py3-none-any.whl? Please share!