ImportError /lib/ld-linux-armhf.so.3: 找不到版本 `gLIB _2.4`

1 投票
1 回答
1116 浏览
提问于 2025-05-11 00:02

我现在遇到了一个导入错误,似乎是在使用Python的requests模块时出现的。以下是我在树莓派上看到的错误信息:

Traceback (most recent call last):
  File "pathfinderAllocator.py", line 4, in <module>
    import requests
  File "/usr/local/lib/python2.7/dist-packages/requests-2.7.0-py2.7.egg/requests/__init__.py", line 58, in <module>
    from . import utils
  File "/usr/local/lib/python2.7/dist-packages/requests-2.7.0-py2.7.egg/requests/utils.py", line 15, in <module>
    import io
  File "/usr/lib/python2.7/io.py", line 51, in <module>
    import _io
ImportError: /lib/ld-linux-armhf.so.3: version `gLIB▒_2.4' not found (required by /usr/lib/python2.7/lib-dynload/_io.so)

我尝试去那个目录查看,发现/lib/ld-linux-armhf.so.3这个文件是存在的。然后我又尝试对/usr/lib/python2.7/lib-dynload/_io.so这个文件使用ldd命令,结果显示有一些文件缺失?

ldd /usr/lib/python2.7/lib-dynload/_io.so
/usr/lib/python2.7/lib-dynload/_io.so: /lib/ld-linux-armhf.so.3: version `gLIB▒_2.4' not found (required by /usr/lib/python2.7/lib-dynload/_io.so)
/usr/lib/python2.7/lib-dynload/_io.so: /lib/arm-linux-gnueabihf/libc.so.6: version `gLIB▒_2.4' not found (required by /usr/lib/python2.7/lib-dynload/_io.so)
/usr/lib/python2.7/lib-dynload/_io.so: /lib/arm-linux-gnueabihf/libpthread.so.0: version `gLIB▒_2.4' not found (required by /usr/lib/python2.7/lib-dynload/_io.so)
        linux-vdso.so.1 (0x7efc4000)
        /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0x76f3f000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x76f07000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76dca000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x76d9d000)
        /lib/ld-linux-armhf.so.3 (0x54ae7000)

我在我的树莓派上只安装了一个Python版本,就是Python 2.7。

这是我的libc6版本:

Package: libc6
State: installed
Automatically installed: no
Multi-Arch: same
Version: 2.19-18+deb8u1
Priority: required
Section: libs
Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
Architecture: armhf
Uncompressed Size: 9,000 k
Depends: libgcc1
Suggests: glibc-doc, debconf | debconf-2.0, locales
Conflicts: prelink (<= 0.0.20090311-1), tzdata (< 2007k-1), tzdata-etch
Breaks: hurd (< 1:0.5.git20140203-1), libtirpc1 (< 0.2.3), locales (< 2.19), locales-all (< 2.19), nscd (< 2.19)
Description: GNU C Library: Shared libraries
 Contains the standard libraries that are used by nearly all programs on the system. This package includes shared versions of the standard C library and the standard math library, as well as many
 others.
Homepage: http://www.gnu.org/software/libc/libc.html

我还尝试使用sudo apt-get install glib2.0命令来安装,但返回的信息是:

    Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libglib2.0-0-refdbg' for regex 'glib2.0'
Note, selecting 'libglib2.0-bin' for regex 'glib2.0'
Note, selecting 'libglib2.0-dbg' for regex 'glib2.0'
Note, selecting 'libglib2.0-cil' for regex 'glib2.0'
Note, selecting 'libglib2.0-dev' for regex 'glib2.0'
Note, selecting 'libglib2.0-doc' for regex 'glib2.0'
Note, selecting 'libglib2.0-cil-dev' for regex 'glib2.0'
Note, selecting 'libtaglib2.0-cil' for regex 'glib2.0'
Note, selecting 'libdbus-glib2.0-cil' for regex 'glib2.0'
Note, selecting 'libdbus-glib2.0-cil-dev' for regex 'glib2.0'
Note, selecting 'libglib2.0-data' for regex 'glib2.0'
Note, selecting 'libglib2.0-tests' for regex 'glib2.0'
Note, selecting 'libglib2.0-0' for regex 'glib2.0'
Note, selecting 'libglib2.0-0-dbg' for regex 'glib2.0'
libglib2.0-0 is already the newest version.
libglib2.0-0 set to manually installed.
libglib2.0-data is already the newest version.
libglib2.0-data set to manually installed.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libglib2.0-bin : Depends: libelfg0 (>= 0.8.12) but it is not installable
E: Unable to correct problems, you have held broken packages.

相关文章:

  • 暂无相关问题
暂无标签

1 个回答

1

python2.7/lib-dynload/_io.so 是一个基本的 Python 2.7 文件。举个例子:

 $ objdump -Dslx /usr/lib/python2.7/lib-dynload/_io.so  | grep -i gLIB
    0x0d696912 0x00 07 GLIBC_2.2
    0x0d696910 0x00 03 GLIBC_2.0
    0x0d696911 0x00 08 GLIBC_2.1
    0x0d696912 0x00 06 GLIBC_2.2
    0x09691f73 0x00 05 GLIBC_2.1.3
    0x0d696914 0x00 04 GLIBC_2.4
    0x0d696910 0x00 02 GLIBC_2.0
 203c 474c4942 435f322e 3200474c 4942435f  GLIBC_2.2.GLIBC_
 204c 322e3000 474c4942 435f322e 3100474c  2.0.GLIBC_2.1.GL
 205c 4942435f 322e312e 3300474c 4942435f  IBC_2.1.3.GLIBC_

这里的疑问是,你的系统里有一个 glibc = libc6,但却没有名为 GLIBC_2.4 的对象。

还有,为什么你系统里的 Python 2.7 是用不同的 glibc 编译的呢?


撰写回答