microsoft / TextWorld

​TextWorld is a sandbox learning environment for the training and evaluation of reinforcement learning (RL) agents on text-based games.
Other
1.22k stars 188 forks source link

Installation errors on linux aarch64 #357

Open DavidePaglieri opened 2 weeks ago

DavidePaglieri commented 2 weeks ago

Hi there, when trying to install textworld on linux aarch64 with pip install textworld, I get this error during the installation of inform7.

[...]
Running setup.sh...
      ++ uname -s
      + unameOut=Linux
      + case "${unameOut}" in
      + machine=Linux
      + cd textworld/thirdparty/
      + '[' '!' -e I7_6M62_Linux_all.tar.gz ']'
      + echo 'Downloading Inform7 CLI'
      Downloading Inform7 CLI
      + curl -LO http://emshort.com/inform-app-archive/6M62/I7_6M62_Linux_all.tar.gz
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed

        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       13 22.1M   13 2991k    0     0  3222k      0  0:00:07 --:--:--  0:00:07 3220k
      100 22.1M  100 22.1M    0     0  15.6M      0  0:00:01  0:00:01 --:--:-- 15.6M
      + '[' Linux == Mac ']'
      + '[' '!' -d inform7-6M62 ']'
      + tar xf I7_6M62_Linux_all.tar.gz
      + echo 'Installing Inform7 CLI'
      Installing Inform7 CLI
      + cd inform7-6M62/
      + tar xzf inform7-common_6M62_all.tar.gz
      + '[' Linux '!=' Mac ']'
      ++ uname -m
      + ARCH=aarch64
      + tar xzf inform7-compilers_6M62_aarch64.tar.gz
      tar (child): inform7-compilers_6M62_aarch64.tar.gz: Cannot open: No such file or directory
      tar (child): Error is not recoverable: exiting now
      tar: Child returned status 2
      tar: Error is not recoverable: exiting now
[...]
note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for textworld
  Building wheel for jericho (setup.py) ... done
  Created wheel for jericho: filename=jericho-3.3.0-py3-none-any.whl size=323988 sha256=67b0f001e48aeaa6dc299b4265d62d9e74f2a14447a678d70427203cd4b7bc33
  Stored in directory: /tmp/pip-ephem-wheel-cache-miw_a459/wheels/be/45/8b/50c2d9429695074a38f4170d11793578a11a5e12417534933d
Failed to build textworld
ERROR: Could not build wheels for textworld, which is required to install pyproject.toml-based projects

This is because there are no inform7 wheels for aarch64 on the link provided. Looking around, I could not yet find a version of inform7 for aarch64. This might be because inform7 is extremely outdated.

Given that linux machines with ARM64 processors are becoming more and more popular, is there any plan to support it, or is there any known workaround?

MarcCote commented 1 week ago

Thanks for reporting this. Until now, I only seen MacOS users having this issue (see https://github.com/microsoft/TextWorld/issues/310 and https://github.com/alfworld/alfworld/issues/44). The easiest solution for them was to use conda with CONDA_SUBDIR=osx-64 conda create -n textworld python=3.9. I don't know if there's an equivalent for Linux, though.

TextWorld is using an old version of Inform7 (circa 2018 and maybe older). That said, the Inform project has moved on and is now open-source (https://github.com/ganelson/inform). In theory, it could be compiled for aarch64. I have no ideas if there are breaking changes with more Inform7 v10.2 and if that can work with TextWorld. I unfortunately don't have the bandwidth to look into this at the moment. If you are willing to try, I'd gladly accept PRs :).

That said, Inform7 is used to generate new games. Nowadays, I don't think people actually when to make new games with TextWorld, so maybe we could make Inform7 optional. But again, I can't work on this at the moment. PRs are welcome.

DavidePaglieri commented 1 week ago

Thank you for the quick reply, would a PR that simply removed the installation of inform7 on linux aarch64 by default work for you? If so I'm happy to open that.

MarcCote commented 1 week ago

We can start with that with proper warning messages being raised when trying to generate games, maybe. This will require changing some of the unit tests too.