0

I have been compiling and installing OpenCV 3.2.0 for python 3.6m on my Ubuntu 16.10 workstation.

Unfortunately, I get the following error:

user@host ~/D/o/cmake> python3 -c "import cv2"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: /usr/local/lib/python3.6/dist-packages/cv2.cpython-36m-x86_64-linux-gnu.so: 
    undefined symbol: _Z13pyopencv_fromIN2cv4MatxIdLi4ELi4EEEEP7_objectRKT_

I have been configuring cmake as follows:

cmake \                                                                                   
    -D BUILD_opencv_python3=ON \                                                          
    -D HAVE_opencv_python3=ON \                                                           
    -D PYTHON3LIBS_VERSION_STRING=3.6m \                                                  
    -D PYTHON3_LIBRARIES=/usr/lib/x86_64-linux-gnu/libpython3.6m.so \                     
    -D PYTHON3_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.6im.so \                      
    -D PYTHON3_INCLUDE_PATH=/usr/include/python3.6m \                                     
    -D PYTHON3_INCLUDE_DIR=/usr/include/python3.6m \                                      
    -D CMAKE_BUILD_TYPE=RELEASE \                                                         
    -D CMAKE_INSTALL_PREFIX=/usr/local \                                                  
    -D BUILD_NEW_PYTHON_SUPPORT=ON \                                                      
    -D INSTALL_C_EXAMPLES=ON \                                                            
    -D INSTALL_PYTHON_EXAMPLES=ON \                                                       
    -D BUILD_EXAMPLES=ON \                                                                
    -DENABLE_PRECOMPILED_HEADERS=OFF \                                                    
    -D OPENCV_EXTRA_MODULES_PATH=/home/user/Downloads/opencv_contrib/modules ..      

Any idea on what might have caused the undefined symbol? Might be this related with ldconfig?

fstab
  • 4,801
  • 8
  • 34
  • 66

0 Answers0