Closed maximzxc closed 2 years ago
I'm not certain what's going on here but the issue seems to originate from system headers on your machine?
My suspicion is that there's incompatible headers installed on your system, e.g. both GCC and clang? Hard to say from here and Google doesn't seem to yield anything meaningful.
I see, hopped that you might know something... I also have no idea, looks weird indeed, it's a newly installed OS, had no chance to pollute it with garbage yet. I have only gcc now.
➜ which clang
clang not found
➜ which gcc
/usr/bin/gcc
If you manage to reproduce this inside Dockers I'd be interested and will follow up (perhaps more likely in the new year).
It seems like the issue is caused by gblic starting from 2.34 version, I can reproduce it in docker with ubuntu:impish-20211102 for example, but with ubuntu:hirsute-20211107 all works well. The only problem is that it's almost impossible to downgrade glibc in ubuntu locally and working with docker is not always convenient.
That's great info, thanks!
Can you share the Docker file(s)?
Sure, you can find them here: https://gist.github.com/maximzxc/c9666de324737b4e27d12dbe56ab6d71
hirsute uses glibc 2.33 by default impish uses glibc 2.34 by default
Hey @maximzxc,
Thanks again for the report and the reproduction example.
It turns out the same issue shows up in upstream NetHack. Or at least it did, until commit https://github.com/NetHack/NetHack/commit/1cb5dc04605daa45f1c6a647c17442ed7ff2fe4e in early January (I wonder if this is a coincidence; it probably is). At any rate, this should be fixed in #299.
To test this, note that you'd have to change your Dockerfile slightly to use the local sources:
FROM ubuntu:impish-20211102
ARG PYTHON_VERSION=3.8
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -yq \
bison \
build-essential \
cmake \
curl \
flex \
git \
libbz2-dev \
ninja-build \
wget
WORKDIR /opt/conda_setup
RUN curl -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
chmod +x miniconda.sh && \
./miniconda.sh -b -p /opt/conda && \
/opt/conda/bin/conda install -y python=$PYTHON_VERSION && \
/opt/conda/bin/conda clean -ya
ENV PATH /opt/conda/bin:$PATH
COPY . /opt/nle/
WORKDIR /opt/nle
RUN pip install . # NOTE CHANGE HERE.
WORKDIR /workspace
CMD ["/bin/bash"]
Hey @heiner,
Thank you for the fix!
It builds well now, can't test anything yet because after the build I got a new error:
Successfully built 38d060ce4acc
Successfully tagged nle:latest
➜ nle git:(heiner/fix-impish-build-error) ✗ docker run -t -i nle python -c "import nle"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/conda/lib/python3.8/site-packages/nle/__init__.py", line 4, in <module>
import nle.env
File "/opt/conda/lib/python3.8/site-packages/nle/env/__init__.py", line 5, in <module>
from nle.env.base import NLE, DUNGEON_SHAPE
File "/opt/conda/lib/python3.8/site-packages/nle/env/base.py", line 17, in <module>
from nle import nethack
File "/opt/conda/lib/python3.8/site-packages/nle/nethack/__init__.py", line 3, in <module>
from nle._pynethack.nethack import * # noqa: F403
ImportError: /opt/conda/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /opt/conda/lib/python3.8/site-packages/nle/_pynethack.cpython-38-x86_64-linux-gnu.so)
But probably the initial issue can be marked as fixed now. And this new one I'll try to resolve on weekends.
Hey @maximzxc,
Thanks for the quick response.
The issue you encounter here has to do with the libstdc++.so.6
in conda shadowing the system one. If you do rm /opt/conda/lib/libstdc++.so*
inside the docker container things will work. (But that is perhaps not the best way to fix this.)
I'm getting the following error on
pip install nle
Environment: