带有 Python OpenCV 的 ImportError(未定义符号)

Posted

技术标签:

【中文标题】带有 Python OpenCV 的 ImportError(未定义符号)【英文标题】:ImportError with Python OpenCV (undefined symbol) 【发布时间】:2017-03-09 15:49:08 【问题描述】:

我从源代码构建了 OpenCV 3.1.0,当我尝试在 Python 中 import cv2 时出现以下错误:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/lib/python2.7/dist-packages/cv2.x86_64-linux-gnu.so: undefined symbol: _ZN2cv9Algorithm7getListERSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE

操作系统是 Ubuntu 16.04 LTS。我关注了this guide to build OpenCV with CUDA 8.0。

【问题讨论】:

【参考方案1】:

安装 glib!

例如,如果您使用 Anaconda,请运行以下命令:

conda install -c anaconda glib

【讨论】:

您能否详细说明与此问题的相关性?

以上是关于带有 Python OpenCV 的 ImportError(未定义符号)的主要内容,如果未能解决你的问题,请参考以下文章