打开CV导入错误:/lib/x86_64-linux-gnu/libwayland-client.so.0:未定义符号:ffi_type_uint32,版本LIBFFI_BASE_7.0

问题描述 投票:0回答:2

我已经安装了 OpenCV,当尝试在 python 中导入 cv2 时,出现以下错误。导入工作正常,直到我安装/卸载并重新安装张量流。

OpenCV已经使用cmake安装在conda环境中。 知道如何解决这个问题吗?

Python 3.10.9 (main, Jan 11 2023, 15:21:40) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/deleeps/anaconda3/envs/zscore/lib/python3.10/site-packages/cv2/__init__.py", line 102, in <module>
    bootstrap()
  File "/home/deleeps/anaconda3/envs/zscore/lib/python3.10/site-packages/cv2/__init__.py", line 90, in bootstrap
    import cv2
ImportError: /lib/x86_64-linux-gnu/libwayland-client.so.0: undefined symbol: ffi_type_uint32, version LIBFFI_BASE_7.0
>>> 


$ ldconfig -p | grep libwayland-client
    libwayland-client.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libwayland-client.so.0
    libwayland-client.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libwayland-client.so
    libwayland-client++.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libwayland-client++.so.0
python opencv conda undefined-symbol libffi
2个回答
4
投票

我通过这样做解决了类似的问题:

export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libffi.so.7


0
投票

我必须安装(或者升级)

cffi
软件包:

python -m pip install -U cffi

© www.soinside.com 2019 - 2024. All rights reserved.