Ask Your Question
0

after build opencv with -DBUILD_SHARED_LIBS=OFF, I still need external libraries to run apps with opencv.

asked 2019-05-30 04:53:35 -0600

zyuwang gravatar image

I use a ubuntu 1604 python 3.6 docker image to set up the build environments. And successfully built opencv python3 with -DBUILD_SHARED_LIBS=OFF.

But when I copy the cv2.cpython-36m-x86_64-linux-gnu.so file to other container base on a same image, I still need to set up environments to use this library such as libjpeg, libpng, libwebp and so on.

How can I get the same result with the case directly use "pip install opencv-python"? When I use pip install opencv-python, I don't need to set up others environments any more.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-05-31 00:32:31 -0600

berak gravatar image

try cmake -DBUILD_JPEG=ON -DBUILD_PNG=ON , etc, so it's using the provided 3rdparty codecs (from src), instead of trying to use your system's dynamic libs at runtime.

edit flag offensive delete link more

Comments

Thanks for your answer. I make it right now.

zyuwang gravatar imagezyuwang ( 2019-06-04 00:29:57 -0600 )edit

Hi, berak I still have a little problem here. I have added all the -DBUILD_xxx parameters which seem related ON now, but ImportError:libdc1394.so.22 come out all the time. I can't figure out, can you give me some advice here? Thanks~

zyuwang gravatar imagezyuwang ( 2019-06-10 22:47:46 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-05-30 04:53:35 -0600

Seen: 414 times

Last updated: May 30 '19