树莓派上的GLIBC版本问题

时间:2019-02-20 12:36:43

标签: raspberry-pi3 glibc dlib

我正在尝试在我的树莓派模型3B上运行face recognition框架。完成安装后,尝试使用python3 facerec_on_raspberry_pi.py执行示例代码时出现以下错误:

Traceback (most recent call last):
  File "facerec_on_raspberry_pi.py", line 9, in <module>
    import face_recognition
  File "/usr/local/lib/python3.6/site-packages/face_recognition/__init__.py", line 7, in <module>
    from .api import load_image_file, face_locations, batch_face_locations, face_landmarks, face_encodings, compare_faces, face_distance
  File "/usr/local/lib/python3.6/site-packages/face_recognition/api.py", line 4, in <module>
    import dlib
ImportError: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.27' not found (required by /usr/local/lib/python3.6/site-packages/dlib.cpython-36m-arm-linux-gnueabihf.so)

以下是有关我的覆盆子的一些规格:

PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
Debian version 9.8
Linux raspberrypi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux

ldd --version的输出

ldd (Debian GLIBC 2.24-11+deb9u4) 2.24
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

/lib/arm-linux-gnueabihf/libc.so.6的输出

GNU C Library (Debian GLIBC 2.24-11+deb9u4) stable release version 2.24, by Roland McGrath et al.
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 6.3.0 20170516.
Available extensions:
    crypt add-on version 2.1 by Michael Glad and others
    GNU Libidn by Simon Josefsson
    Native POSIX Threads Library by Ulrich Drepper et al
    BIND-8.2.3-T5B
libc ABIs: UNIQUE
For bug reporting instructions, please see:
<http://www.debian.org/Bugs/>.

有人可以帮我吗?

1 个答案:

答案 0 :(得分:0)

您安装的CPython版本(特别是/usr/local/lib/python3.6/site-packages/dlib.cpython-36m-arm-linux-gnueabihf.so)与您的系统不兼容(需要GLIBC 2.27,而您只有GLIBC 2.24)。

您必须升级已安装的GLIBC,或使用其他内部版本的CPython。

另请参阅this answer