facebookresearch / nle

The NetHack Learning Environment
Other
940 stars 113 forks source link

Pip install nle #187

Closed Shikamaru5 closed 3 years ago

Shikamaru5 commented 3 years ago

I have been trying to pip install nle and when I run it, I keep getting told that I need PEP 517, because it can’t build wheels, and it also won’t install directly, I was wondering if maybe I’m overlooking something, and if someone could please help me.

Shikamaru5 commented 3 years ago

Ok so I've been informed to do the whole shibang in my explanation of the problem, I'll attempt it. I've added the ssh key to gitlab, I have cloned the repository, I have Python 3.9 64 bit, I have cmake version 3.20.4. I have installed the dependencies in Ubuntu latest version. I create the conda env -n nle_challenge python=3.8 'cmake>3.15' and then conda activate nle_challenge. when I try to pip install -r requirements.txt it says everything is satisfied.

(nle_challenge) C:\Users\Kalvin>pip install -r requirements.txt Requirement already satisfied: certifi==2021.5.30 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from -r requirements.txt (line 1)) (2021.5.30) Requirement already satisfied: chardet==4.0.0 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from -r requirements.txt (line 2)) (4.0.0) Requirement already satisfied: docutils==0.17.1 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from -r requirements.txt (line 3)) (0.17.1) Requirement already satisfied: flit==3.2.0 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from -r requirements.txt (line 4)) (3.2.0) Requirement already satisfied: flit-core==3.2.0 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from -r requirements.txt (line 5)) (3.2.0) Requirement already satisfied: idna==2.10 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from -r requirements.txt (line 6)) (2.10) Requirement already satisfied: neat-python==0.92 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from -r requirements.txt (line 7)) (0.92) Requirement already satisfied: requests==2.25.1 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from -r requirements.txt (line 8)) (2.25.1) Requirement already satisfied: toml==0.10.2 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from -r requirements.txt (line 9)) (0.10.2) Requirement already satisfied: urllib3==1.26.6 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from -r requirements.txt (line 10)) (1.26.6)

I have gym installed. I have a few other things installed like I've tried installing pep 517, and I've tried installing wheels, they've both been done successfully. the issue occurs when i try to pip install nle. This is what I get.

(nle_challenge) C:\Users\Kalvin>pip install nle Collecting nle Using cached nle-0.7.2.tar.gz (6.7 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing wheel metadata ... done Requirement already satisfied: gym>=0.15 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from nle) (0.18.3) Requirement already satisfied: pybind11>=2.2 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from nle) (2.6.2) Requirement already satisfied: numpy>=1.16 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from nle) (1.21.0) Requirement already satisfied: scipy in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from gym>=0.15->nle) (1.7.0) Requirement already satisfied: pyglet<=1.5.15,>=1.4.0 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from gym>=0.15->nle) (1.5.15) Requirement already satisfied: Pillow<=8.2.0 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from gym>=0.15->nle) (8.2.0) Requirement already satisfied: cloudpickle<1.7.0,>=1.2.0 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from gym>=0.15->nle) (1.6.0) Building wheels for collected packages: nle Building wheel for nle (PEP 517) ... error ERROR: Command errored out with exit status 1: command: 'c:\users\kalvin\appdata\local\programs\python\python39\python.exe' 'c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages\pip_vendor\pep517\in_process_in_process.py' build_wheel 'C:\Users\Kalvin\AppData\Local\Temp\tmp_v_f_6o7' cwd: C:\Users\Kalvin\AppData\Local\Temp\pip-install-fei76g6m\nle_c7eab0feb583449c8e73cee65c1fbba4 Complete output (47 lines): fatal: not a git repository (or any of the parent directories): .git Building wheel nle-0.7.2 running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.9 creating build\lib.win-amd64-3.9\nle copying nle\version.py -> build\lib.win-amd64-3.9\nle copying nle__init.py -> build\lib.win-amd64-3.9\nle creating build\lib.win-amd64-3.9\nle\env copying nle\env\base.py -> build\lib.win-amd64-3.9\nle\env copying nle\env\tasks.py -> build\lib.win-amd64-3.9\nle\env copying nle\env__init.py -> build\lib.win-amd64-3.9\nle\env creating build\lib.win-amd64-3.9\nle\nethack copying nle\nethack\actions.py -> build\lib.win-amd64-3.9\nle\nethack copying nle\nethack\nethack.py -> build\lib.win-amd64-3.9\nle\nethack copying nle\nethack\init.py -> build\lib.win-amd64-3.9\nle\nethack creating build\lib.win-amd64-3.9\nle\agent copying nle\agent\agent.py -> build\lib.win-amd64-3.9\nle\agent copying nle\agent\vtrace.py -> build\lib.win-amd64-3.9\nle\agent copying nle\agent\init__.py -> build\lib.win-amd64-3.9\nle\agent creating build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\check_nethack_speed.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\collect_env.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\play.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\plot.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\read_heaplog.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\read_tty.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\test_raw_nethack.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\ttyplay.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\ttyplay2.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\ttyrec.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\init.py -> build\lib.win-amd64-3.9\nle\scripts package init file 'nle\tests\init.py' not found (or not a regular file) creating build\lib.win-amd64-3.9\nle\tests copying nle\tests\test_envs.py -> build\lib.win-amd64-3.9\nle\tests copying nle\tests\test_nethack.py -> build\lib.win-amd64-3.9\nle\tests copying nle\tests\test_profile.py -> build\lib.win-amd64-3.9\nle\tests running build_ext Traceback (most recent call last): File "c:\users\kalvin\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\users\kalvin\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\Kalvin\AppData\Local\Programs\Python\Python39\Scripts\cmake.exe\main__.py", line 4, in ModuleNotFoundError: No module named 'cmake'

ERROR: Failed building wheel for nle Failed to build nle ERROR: Could not build wheels for nle which use PEP 517 and cannot be installed directly

So I asked that and was informed that I should try a maybe short term patch pip install --no-use-pep517 nle. It doesn't work, this is what I get.

(nle_challenge) C:\Users\Kalvin>pip install --no-use-pep517 nle Collecting nle Using cached nle-0.7.2.tar.gz (6.7 MB) Requirement already satisfied: pybind11>=2.2 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from nle) (2.6.2) Requirement already satisfied: numpy>=1.16 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from nle) (1.21.0) Requirement already satisfied: gym>=0.15 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from nle) (0.18.3) Requirement already satisfied: scipy in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from gym>=0.15->nle) (1.7.0) Requirement already satisfied: pyglet<=1.5.15,>=1.4.0 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from gym>=0.15->nle) (1.5.15) Requirement already satisfied: Pillow<=8.2.0 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from gym>=0.15->nle) (8.2.0) Requirement already satisfied: cloudpickle<1.7.0,>=1.2.0 in c:\users\kalvin\appdata\local\programs\python\python39\lib\site-packages (from gym>=0.15->nle) (1.6.0) Building wheels for collected packages: nle Building wheel for nle (setup.py) ... error ERROR: Command errored out with exit status 1: command: 'c:\users\kalvin\appdata\local\programs\python\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Kalvin\AppData\Local\Temp\pip-install-v3rq9gvp\nle_8d471f6d87e047bcaa81314e646f59eb\setup.py'"'"'; file='"'"'C:\Users\Kalvin\AppData\Local\Temp\pip-install-v3rq9gvp\nle_8d471f6d87e047bcaa81314e646f59eb\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Kalvin\AppData\Local\Temp\pip-wheel-v_3ibock' cwd: C:\Users\Kalvin\AppData\Local\Temp\pip-install-v3rq9gvp\nle_8d471f6d87e047bcaa81314e646f59eb\ Complete output (45 lines): fatal: not a git repository (or any of the parent directories): .git Building wheel nle-0.7.2 running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.9 creating build\lib.win-amd64-3.9\nle copying nle\version.py -> build\lib.win-amd64-3.9\nle copying nle__init.py -> build\lib.win-amd64-3.9\nle creating build\lib.win-amd64-3.9\nle\env copying nle\env\base.py -> build\lib.win-amd64-3.9\nle\env copying nle\env\tasks.py -> build\lib.win-amd64-3.9\nle\env copying nle\env__init.py -> build\lib.win-amd64-3.9\nle\env creating build\lib.win-amd64-3.9\nle\nethack copying nle\nethack\actions.py -> build\lib.win-amd64-3.9\nle\nethack copying nle\nethack\nethack.py -> build\lib.win-amd64-3.9\nle\nethack copying nle\nethack\init.py -> build\lib.win-amd64-3.9\nle\nethack creating build\lib.win-amd64-3.9\nle\agent copying nle\agent\agent.py -> build\lib.win-amd64-3.9\nle\agent copying nle\agent\vtrace.py -> build\lib.win-amd64-3.9\nle\agent copying nle\agent\init__.py -> build\lib.win-amd64-3.9\nle\agent creating build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\check_nethack_speed.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\collect_env.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\play.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\plot.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\read_heaplog.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\read_tty.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\test_raw_nethack.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\ttyplay.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\ttyplay2.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\ttyrec.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\init.py -> build\lib.win-amd64-3.9\nle\scripts package init file 'nle\tests\init__.py' not found (or not a regular file) creating build\lib.win-amd64-3.9\nle\tests copying nle\tests\test_envs.py -> build\lib.win-amd64-3.9\nle\tests copying nle\tests\test_nethack.py -> build\lib.win-amd64-3.9\nle\tests copying nle\tests\test_profile.py -> build\lib.win-amd64-3.9\nle\tests running build_ext CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred! See also "C:/Users/Kalvin/AppData/Local/Temp/pip-install-v3rq9gvp/nle_8d471f6d87e047bcaa81314e646f59eb/build/temp.win-amd64-3.9/Release/CMakeFiles/CMakeOutput.log".

ERROR: Failed building wheel for nle Running setup.py clean for nle Failed to build nle Installing collected packages: nle Running setup.py install for nle ... error ERROR: Command errored out with exit status 1: command: 'c:\users\kalvin\appdata\local\programs\python\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Kalvin\AppData\Local\Temp\pip-install-v3rq9gvp\nle_8d471f6d87e047bcaa81314e646f59eb\setup.py'"'"'; file='"'"'C:\Users\Kalvin\AppData\Local\Temp\pip-install-v3rq9gvp\nle_8d471f6d87e047bcaa81314e646f59eb\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Kalvin\AppData\Local\Temp\pip-record-slw9ui7w\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\kalvin\appdata\local\programs\python\python39\Include\nle' cwd: C:\Users\Kalvin\AppData\Local\Temp\pip-install-v3rq9gvp\nle_8d471f6d87e047bcaa81314e646f59eb\ Complete output (45 lines): fatal: not a git repository (or any of the parent directories): .git Building wheel nle-0.7.2 running install running build running build_py creating build creating build\lib.win-amd64-3.9 creating build\lib.win-amd64-3.9\nle copying nle\version.py -> build\lib.win-amd64-3.9\nle copying nle__init.py -> build\lib.win-amd64-3.9\nle creating build\lib.win-amd64-3.9\nle\env copying nle\env\base.py -> build\lib.win-amd64-3.9\nle\env copying nle\env\tasks.py -> build\lib.win-amd64-3.9\nle\env copying nle\env__init.py -> build\lib.win-amd64-3.9\nle\env creating build\lib.win-amd64-3.9\nle\nethack copying nle\nethack\actions.py -> build\lib.win-amd64-3.9\nle\nethack copying nle\nethack\nethack.py -> build\lib.win-amd64-3.9\nle\nethack copying nle\nethack\init.py -> build\lib.win-amd64-3.9\nle\nethack creating build\lib.win-amd64-3.9\nle\agent copying nle\agent\agent.py -> build\lib.win-amd64-3.9\nle\agent copying nle\agent\vtrace.py -> build\lib.win-amd64-3.9\nle\agent copying nle\agent\init__.py -> build\lib.win-amd64-3.9\nle\agent creating build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\check_nethack_speed.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\collect_env.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\play.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\plot.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\read_heaplog.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\read_tty.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\test_raw_nethack.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\ttyplay.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\ttyplay2.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\ttyrec.py -> build\lib.win-amd64-3.9\nle\scripts copying nle\scripts\init.py -> build\lib.win-amd64-3.9\nle\scripts package init file 'nle\tests\init__.py' not found (or not a regular file) creating build\lib.win-amd64-3.9\nle\tests copying nle\tests\test_envs.py -> build\lib.win-amd64-3.9\nle\tests copying nle\tests\test_nethack.py -> build\lib.win-amd64-3.9\nle\tests copying nle\tests\test_profile.py -> build\lib.win-amd64-3.9\nle\tests running build_ext CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred! See also "C:/Users/Kalvin/AppData/Local/Temp/pip-install-v3rq9gvp/nle_8d471f6d87e047bcaa81314e646f59eb/build/temp.win-amd64-3.9/Release/CMakeFiles/CMakeOutput.log".

ERROR: Command errored out with exit status 1: 'c:\users\kalvin\appdata\local\programs\python\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Kalvin\AppData\Local\Temp\pip-install-v3rq9gvp\nle_8d471f6d87e047bcaa81314e646f59eb\setup.py'"'"'; file='"'"'C:\Users\Kalvin\AppData\Local\Temp\pip-install-v3rq9gvp\nle_8d471f6d87e047bcaa81314e646f59eb\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\Kalvin\AppData\Local\Temp\pip-record-slw9ui7w\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\kalvin\appdata\local\programs\python\python39\Include\nle' Check the logs for full command output.

I've even tried uninstalling pep517 and running pip install nle and pip install --no-use-pep517 nle', which grants me the same effect as if I just loaded the original thought, so i reinstalled that just in case it is important. I've tried running the command in Anaconda, in Git, in the command prompt, and in python and they all give me the same. Maybe am I supposed to be trying it in Pycharm or Sublime?

I hope this isn't a poor question to be asking but does anyone know how to fix it, because it seems as if I've installed and downloaded everything under the sun but the main thing the nle doesn't want to install.

Please and thank you,

Kalvin.

heiner commented 3 years ago

Hey Kalvin,

Thanks for your interest in NLE and the follow-up information you provide here.

It seems you are looking to use NLE on Windows, which isn't currently supported unfortunately. If you cannot switch to either Linux or MacOS, our suggestion would be to try to use Docker on Windows if you want to use NLE.

Shikamaru5 commented 3 years ago

Thank you, I have downloaded and tried it on the Ubuntu for windows but I could try it again, do you know if the code to type in is different than the pip install nle?

heiner commented 3 years ago

Hey Kalvin,

On a recent Linux or MacOS, pip install nle should install NLE without any issues.

I'm not certain what "Ubuntu for Windows" refers to, however. Googling suggests you might be referring to this tool; it seems dubious to me if that will be enough to compile NLE in its current form, as we require a full Unix-like environment. If you cannot leave the Windows system, it's probably better to try to use Docker, which gives you a full virtual Ubuntu system.

Shikamaru5 commented 3 years ago

Alright thank you for your help, it's greatly appreciated I'll attempt some more tries, hopefully if we chat again it'll be with a modicum of success.