Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python 3.11 not using conda lib path when load modules #673

Open
1 task done
galaxy001 opened this issue Feb 5, 2024 · 2 comments
Open
1 task done

python 3.11 not using conda lib path when load modules #673

galaxy001 opened this issue Feb 5, 2024 · 2 comments
Labels

Comments

@galaxy001
Copy link

galaxy001 commented Feb 5, 2024

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

python3 -c 'import pandas;' failed as "ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /share/home/uuu/micromamba/envs/n311/lib/python3.11/site-packages/pandas/_libs/window/aggregations.cpython-311-x86_64-linux-gnu.so)"

LD_LIBRARY_PATH=/share/home/uuu/micromamba/envs/n311/lib python3 -c 'import pandas;' works.

(n311) [uuu@c001 test]$ echo $LD_LIBRARY_PATH

(n311) [uuu@c001 test]$ ldd /share/home/uuu/micromamba/envs/n311/lib/python3.11/site-packages/pandas/_libs/window/aggregations.cpython-311-x86_64-linux-gnu.so
        linux-vdso.so.1 (0x00007fff65a6d000)
        libstdc++.so.6 => /share/home/uuu/micromamba/envs/n311/lib/python3.11/site-packages/pandas/_libs/window/../../../../../libstdc++.so.6 (0x00007f77ec0d8000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f77ebd56000)
        libgcc_s.so.1 => /share/home/uuu/micromamba/envs/n311/lib/python3.11/site-packages/pandas/_libs/window/../../../../../libgcc_s.so.1 (0x00007f77ec469000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f77eb991000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f77eb789000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f77ec2bb000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f77eb569000)

$ readelf -d /share/home/uuu/micromamba/envs/n311/lib/python3.11/site-packages/pandas/_libs/window/aggregations.cpython-311-x86_64-linux-gnu.so

Dynamic section at offset 0x50778 contains 28 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000f (RPATH)              Library rpath: [$ORIGIN/../../../../..]

$ readelf -d /share/home/uuu/micromamba/envs/n311/bin/python3

Dynamic section at offset 0x44a230 contains 34 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libutil.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [librt.so.1]
 0x000000000000000f (RPATH)              Library rpath: [$ORIGIN/../lib]

It seems rpath with $ORIGIN not working properly.

Installed packages

  python                                3.11.7           hab00c5b_1_cpython        conda-forge
  python_abi                            3.11             4_cp311                   conda-forge
  pandas                                2.0.3            py311h320fe9a_1           conda-forge
  libstdcxx-devel_linux-64              13.2.0           ha9c7c90_103              conda-forge
  libstdcxx-ng                          13.2.0           h7e041cc_3                conda-forge
  libsystemd0                           255              h3516f8a_0                conda-forge
  gcc                                   13.2.0           h574f8da_2                conda-forge
  gcc_impl_linux-64                     13.2.0           h338b0a0_3                conda-forge

... ...

Environment info

libmamba version : 1.5.5
     micromamba version : 1.5.5
           curl version : libcurl/8.5.0 OpenSSL/3.2.0 zlib/1.2.13 zstd/1.5.5 libssh2/1.11.0 nghttp2/1.58.0
     libarchive version : libarchive 3.7.2 zlib/1.2.13 bz2lib/1.0.8 libzstd/1.5.5
       envs directories : /share/home/uuu/micromamba/envs
          package cache : /share/home/uuu/micromamba/pkgs
                          /share/home/uuu/.mamba/pkgs
            environment : n311 (active)
           env location : /share/home/uuu/micromamba/envs/n311
      user config files : /share/home/uuu/.mambarc
 populated config files : /share/home/uuu/.condarc
       virtual packages : __unix=0=0
                          __linux=4.18.0=0
                          __glibc=2.28=0
                          __archspec=1=x86_64-v4
               channels : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/bioconda/linux-64
                          https://conda.anaconda.org/bioconda/noarch
                          https://conda.anaconda.org/nodefaults/linux-64
                          https://conda.anaconda.org/nodefaults/noarch
                          https://conda.anaconda.org/pytorch/linux-64
                          https://conda.anaconda.org/pytorch/noarch
                          https://conda.anaconda.org/nvidia/linux-64
                          https://conda.anaconda.org/nvidia/noarch
                          https://conda.anaconda.org/intel/linux-64
                          https://conda.anaconda.org/intel/noarch
       base environment : /share/home/uuu/micromamba
               platform : linux-64
@galaxy001 galaxy001 added the bug label Feb 5, 2024
@galaxy001
Copy link
Author

pyarrow 14.0.2 /share/home/uuu/micromamba/envs/n311/lib/python3.11/site-packages pip

$ strace python3 -c 'import pandas' 2>&1 |grep -i libstdc++
openat(AT_FDCWD, "/share/home/uuu/micromamba/envs/n311/lib/python3.11/site-packages/pyarrow/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 4

$ ls /share/home/uuu/micromamba/envs/n311/lib/python3.11/site-packages/pyarrow/libstdc*
ls: cannot access '/share/home/uuu/micromamba/envs/n311/lib/python3.11/site-packages/pyarrow/libstdc*': No such file or directory

I just find it is another bug.

@galaxy001
Copy link
Author

galaxy001 commented Feb 6, 2024

$ readelf -d /share/home/uuu/micromamba/envs/n311/lib/python3.11/site-packages/pyarrow/libarrow.so.1400

Dynamic section at offset 0x289a528 contains 33 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [librt.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [ld-linux-x86-64.so.2]
 0x000000000000000e (SONAME)             Library soname: [libarrow.so.1400]
 0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN]

So, pip just set runpath to $ORIGIN, not sth. like $ORIGIN/../../../../... It might be better to modify its default behavior.

Reported to pip-feedstock as conda-forge/pip-feedstock#116.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant