minerl icon indicating copy to clipboard operation
minerl copied to clipboard

Error while installing minerl - getch

Open itaiwe opened this issue 3 years ago • 1 comments

Hello, I'm trying to install minerl in wsl2 (ubuntu 20.04) on windows 11 and i got an error while building.

Does anyone know what could be causing this error?

itaiwe@DESKTOP-NLON536:~$ pip install --upgrade minerl
Defaulting to user installation because normal site-packages is not writeable
Collecting minerl
  Using cached minerl-0.4.4-cp39-cp39-linux_x86_64.whl
Collecting gym<0.20,>=0.13.1
  Using cached gym-0.19.0-py3-none-any.whl
Requirement already satisfied: setuptools>=49.2.0 in ./.local/lib/python3.9/site-packages (from minerl) (65.3.0)
Requirement already satisfied: filelock in /usr/lib/python3/dist-packages (from minerl) (3.0.12)
Collecting daemoniker>=0.2.3
  Using cached daemoniker-0.2.3-py3-none-any.whl (33 kB)
Requirement already satisfied: pillow>=8.0.0 in ./.local/lib/python3.9/site-packages (from minerl) (9.2.0)
Collecting getch>=1.0
  Using cached getch-1.0.tar.gz (1.3 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: requests>=2.20.0 in /usr/lib/python3/dist-packages (from minerl) (2.22.0)
Collecting jinja2>=2.11.2
  Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting simple-term-menu
  Using cached simple_term_menu-1.5.2-py3-none-any.whl (26 kB)
Requirement already satisfied: numpy>=1.16.2 in ./.local/lib/python3.9/site-packages (from minerl) (1.23.1)
Collecting lxml>=4.3.3
  Using cached lxml-4.9.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (7.0 MB)
Collecting xmltodict==0.12.0
  Using cached xmltodict-0.12.0-py2.py3-none-any.whl (9.2 kB)
Requirement already satisfied: matplotlib>=3.2.2 in ./.local/lib/python3.9/site-packages (from minerl) (3.5.3)
Collecting bullet
  Using cached bullet-2.2.0-py3-none-any.whl (10 kB)
Collecting coloredlogs>=10.0
  Using cached coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB)
Collecting inflection>=0.3.1
  Using cached inflection-0.5.1-py2.py3-none-any.whl (9.5 kB)
Collecting dill>=0.3.1.1
  Using cached dill-0.3.6-py3-none-any.whl (110 kB)
Collecting opencv-python>=4.1.0.25
  Using cached opencv_python-4.6.0.66-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (60.9 MB)
Collecting Pyro4>=4.76
  Using cached Pyro4-4.82-py2.py3-none-any.whl (89 kB)
Requirement already satisfied: pytest in ./.local/lib/python3.9/site-packages (from minerl) (7.1.2)
Collecting tqdm>=4.32.2
  Using cached tqdm-4.64.1-py2.py3-none-any.whl (78 kB)
Collecting ipython>=7.5.0
  Using cached ipython-8.6.0-py3-none-any.whl (761 kB)
Requirement already satisfied: psutil>=5.6.2 in ./.local/lib/python3.9/site-packages (from minerl) (5.9.2)
Collecting humanfriendly>=9.1
  Using cached humanfriendly-10.0-py2.py3-none-any.whl (86 kB)
Collecting cloudpickle<1.7.0,>=1.2.0
  Using cached cloudpickle-1.6.0-py3-none-any.whl (23 kB)
Collecting stack-data
  Using cached stack_data-0.6.0-py3-none-any.whl (24 kB)
Requirement already satisfied: pexpect>4.3 in /usr/lib/python3/dist-packages (from ipython>=7.5.0->minerl) (4.6.0)
Collecting traitlets>=5
  Using cached traitlets-5.5.0-py3-none-any.whl (107 kB)
Requirement already satisfied: pickleshare in ./.local/lib/python3.9/site-packages (from ipython>=7.5.0->minerl) (0.7.5)
Requirement already satisfied: pygments>=2.4.0 in ./.local/lib/python3.9/site-packages (from ipython>=7.5.0->minerl) (2.13.0)
Collecting jedi>=0.16
  Using cached jedi-0.18.1-py2.py3-none-any.whl (1.6 MB)
Collecting decorator
  Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting backcall
  Using cached backcall-0.2.0-py2.py3-none-any.whl (11 kB)
Collecting matplotlib-inline
  Using cached matplotlib_inline-0.1.6-py3-none-any.whl (9.4 kB)
Collecting prompt-toolkit<3.1.0,>3.0.1
  Using cached prompt_toolkit-3.0.31-py3-none-any.whl (382 kB)
Collecting MarkupSafe>=2.0
  Using cached MarkupSafe-2.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Requirement already satisfied: pyparsing>=2.2.1 in ./.local/lib/python3.9/site-packages (from matplotlib>=3.2.2->minerl) (3.0.9)
Requirement already satisfied: python-dateutil>=2.7 in ./.local/lib/python3.9/site-packages (from matplotlib>=3.2.2->minerl) (2.8.2)
Requirement already satisfied: packaging>=20.0 in ./.local/lib/python3.9/site-packages (from matplotlib>=3.2.2->minerl) (21.3)
Requirement already satisfied: kiwisolver>=1.0.1 in ./.local/lib/python3.9/site-packages (from matplotlib>=3.2.2->minerl) (1.4.4)
Requirement already satisfied: cycler>=0.10 in ./.local/lib/python3.9/site-packages (from matplotlib>=3.2.2->minerl) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in ./.local/lib/python3.9/site-packages (from matplotlib>=3.2.2->minerl) (4.37.3)
Collecting serpent>=1.27
  Using cached serpent-1.41-py3-none-any.whl (9.6 kB)
Requirement already satisfied: attrs>=19.2.0 in ./.local/lib/python3.9/site-packages (from pytest->minerl) (22.1.0)
Requirement already satisfied: iniconfig in ./.local/lib/python3.9/site-packages (from pytest->minerl) (1.1.1)
Requirement already satisfied: pluggy<2.0,>=0.12 in ./.local/lib/python3.9/site-packages (from pytest->minerl) (1.0.0)
Requirement already satisfied: tomli>=1.0.0 in ./.local/lib/python3.9/site-packages (from pytest->minerl) (2.0.1)
Requirement already satisfied: py>=1.8.2 in ./.local/lib/python3.9/site-packages (from pytest->minerl) (1.11.0)
Collecting parso<0.9.0,>=0.8.0
  Using cached parso-0.8.3-py2.py3-none-any.whl (100 kB)
Requirement already satisfied: wcwidth in ./.local/lib/python3.9/site-packages (from prompt-toolkit<3.1.0,>3.0.1->ipython>=7.5.0->minerl) (0.2.5)
Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.7->matplotlib>=3.2.2->minerl) (1.14.0)
Collecting asttokens>=2.1.0
  Using cached asttokens-2.1.0-py2.py3-none-any.whl (26 kB)
Requirement already satisfied: pure-eval in ./.local/lib/python3.9/site-packages (from stack-data->ipython>=7.5.0->minerl) (0.2.2)
Collecting executing>=1.2.0
  Using cached executing-1.2.0-py2.py3-none-any.whl (24 kB)
Building wheels for collected packages: getch
  Building wheel for getch (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      running bdist_wheel
      running build
      running build_ext
      building 'getch' extension
      creating build
      creating build/temp.linux-x86_64-cpython-39
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/local/include -I/usr/include -I/usr/include/python3.9 -c getchmodule.c -o build/temp.linux-x86_64-cpython-39/getchmodule.o
      getchmodule.c:1:10: fatal error: Python.h: No such file or directory
          1 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for getch
  Running setup.py clean for getch
Failed to build getch
Installing collected packages: getch, executing, daemoniker, bullet, backcall, xmltodict, traitlets, tqdm, simple-term-menu, serpent, prompt-toolkit, parso, opencv-python, MarkupSafe, lxml, inflection, humanfriendly, dill, decorator, cloudpickle, asttokens, stack-data, Pyro4, matplotlib-inline, jinja2, jedi, gym, coloredlogs, ipython, minerl
  Running setup.py install for getch ... error
  error: subprocess-exited-with-error

  × Running setup.py install for getch did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      running install
      /home/itaiwe/.local/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_ext
      building 'getch' extension
      creating build
      creating build/temp.linux-x86_64-cpython-39
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/local/include -I/usr/include -I/usr/include/python3.9 -c getchmodule.c -o build/temp.linux-x86_64-cpython-39/getchmodule.o
      getchmodule.c:1:10: fatal error: Python.h: No such file or directory
          1 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]

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

× Encountered error while trying to install package.
╰─> getch

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

error.txt

itaiwe avatar Nov 03 '22 10:11 itaiwe

This seems to be a problem with getch, not minerl package. See if e.g., this answer helps.

Miffyli avatar Nov 03 '22 19:11 Miffyli