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

John Zhang picture John Zhang · Jun 27, 2016 · Viewed 8.3k times · Source

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

Answer

Solar.gy picture Solar.gy · May 11, 2017

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