Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When build opencv, could not find the file "cv2.so"

I compiled OpenCV 3.0.0 with python2.7 in Debian system at a Board with a extended SD card (BeagleBone Black).

After OpenCV installed, there seems no error. There are many generated files in the 'Lib' folder.

Those files are named like:

libopencv_core.so
libopencv_dataset.so
libopencv_imgproc.so ...

I could not find the file cv2.so, even searched the whole file system.

I have tried several times, just can not find cv2.so.

Who knows the reason? Thanks.

make config checked, seems correct:

sudo cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local -D
like image 533
John Zhang Avatar asked Jun 27 '16 10:06

John Zhang


1 Answers

Make sure you have numpy installed. Without numpy, cmake will say

--   Python 2:
--     Interpreter:                 /usr/bin/python2.7 (ver 2.7.12)
--     Libraries:                   NO
--     numpy:                       NO (Python wrappers can not be generated)
--     packages path:               lib/python2.7/dist-packages

install numpy, and it will say:

--   Python 2:
--     Interpreter:                 /usr/bin/python2.7 (ver 2.7.12)
--     Libraries:                   /usr/lib64/libpython2.7.so (ver 2.7.12)
--     numpy:                       /usr/local/lib/python2.7/dist-packages/numpy/core/include (ver 1.12.1)
--     packages path:               lib/python2.7/dist-packages
like image 127
Solar.gy Avatar answered Sep 30 '22 12:09

Solar.gy