Python导入错误:未定义的符号:_Z33parallel_pthreads_set_threads_numi

时间:2015-11-03 07:38:33

标签: opencv python-3.x image-processing python-3.4 opencv3.0

我正在尝试在CentOS6上编译和安装OpenCV3(针对Python3.4)。 当我cmake时,我设置了以下选项。

BUILD_opencv_python3=ON
BUILD_opencv_videoio=OFF(turned this off because I am not using the video modules and this throws some errors while compiling)
PYTHON3_EXECUTABLE=/usr/local/python/bin/python3.4
PYTHON3_INCLUDE_DIR=/usr/local/python/include/python3.4m
PYTHON3_LIBRARY=/usr/local/python/lib/python3.4
PYTHON3_NUMPY_INCLUDE_DIRS=/usr/local/python/lib/python3.4/site-packages/numpy/core/include
PYTHON3_PACKAGES_PATH=/usr/local/python/lib/python3.4/site-packages

使用上面的配置,compliation很好,但是当我尝试导入输出文件(cv2.cpython-34m.so)时,我收到以下错误。

Python 3.4.3 (default, Nov  2 2015, 17:44:31) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2(←renamed from cv2.cpython-34m.so to this)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /home/dai/opencv-3.0.0/build/lib/libopencv_core.so.3.0: undefined symbol: _Z33parallel_pthreads_set_threads_numi

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

一种可能性是您的文件cv2.cpython-34m.so可以更改为cv2.cpython-34m.py以便导入。这只是一个建议。