libwebp.so.6 Raspberry Pi 3b中的导入错误

时间:2019-02-22 19:22:23

标签: python-3.x opencv raspberry-pi

我使用opencv,imutils和其他库编写了一段代码来识别python3中的面孔。 当我将该代码放到Raspberry Pi 3b上并进行编译时,就会显示此错误:

  File "detect_drowsiness.py", line 7, in <module>
    from imutils.video import VideoStream
  File "/home/pi/.local/lib/python3.5/site-packages/imutils/__init__.py", line 8, in <module>
    from .convenience import translate
  File "/home/pi/.local/lib/python3.5/site-packages/imutils/convenience.py", line 6, in <module>
    import cv2
  File "/home/pi/.local/lib/python3.5/site-packages/cv2/__init__.py", line 3, in <module>
    from .cv2 import *
ImportError: libwebp.so.6: cannot open shared object file: No such file or directory

这些是我正在使用的导入:

from scipy.spatial import distance as dist
from imutils.video import VideoStream
from imutils import face_utils
from threading import Thread
import numpy as np
import playsound
import argparse
import imutils
import time
import dlib
import cv2

我在树莓派上使用pip3一步一步地安装了每个库

Python版本:3.5.3

opencv版本:opencv-python == 3.4.4.19

请询问您可能需要的其他详细信息。

1 个答案:

答案 0 :(得分:1)

您缺少libwebp-dev软件包。要安装它,您应该打开一个终端并输入:

sudo apt-get install libwebp-dev