Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

Not able to import cv2

AbhishekD_Intel
Moderator
1,847 Views

Hi,

I first tried importing OpenCV and it worked and also gave me the correct version.

Then I sourced  OpenVINO environment using setupvars.sh and tried the same importing OpenCV using the following command

import cv2

But I am not able to import it. It is showing me the following error: 

      ImportError: /opt/intel/openvino_2020.2.120/deployment_tools/inference_engine/lib/intel64/libinference_engine.so: undefined symbol: _ZN3tbb8internal13numa_topology4fillEPi

 

I also did ldd -r  libinference_engine.so and all libs are pointing to addresses without any invalid or undefined address as shown below:

        linux-vdso.so.1 (0x00007ffc613e0000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fbb56345000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fbb55f54000)
        libtbb.so.2 => /opt/intel/openvino_2020.2.120/deployment_tools/inference_engine/external/tbb/lib/libtbb.so.2 (0x00007fbb55cec000)
        libinference_engine_transformations.so => /opt/intel/openvino_2020.2.120/deployment_tools/inference_engine/lib/intel64/libinference_engine_transformations.so (0x00007fbb55a1e000)
        libinference_engine_legacy.so => /opt/intel/openvino_2020.2.120/deployment_tools/inference_engine/lib/intel64/libinference_engine_legacy.so (0x00007fbb555ca000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fbb553ab000)
        libngraph.so => /opt/intel/openvino_2020.2.120/deployment_tools/ngraph/lib/libngraph.so (0x00007fbb5497a000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fbb545f1000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fbb543d9000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fbb568f3000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fbb541d1000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fbb53e33000)

I am using Intel(R) Distribution for Python 3.7.5, OpenVINO_2020.2.120, on Ubuntu 18.04

Thanks and Please help me out with this error.

0 Kudos
5 Replies
JAIVIN_J_Intel
Employee
1,847 Views

Hi Abhishek,

Do you have Anaconda installed in your system? If yes, please try re-installing Anaconda as some users has mentioned it as a workaround.

Regards,

Jaivin

 

0 Kudos
AbhishekD_Intel
Moderator
1,847 Views

Hi Jaivin,

Thanks for the help. The issue is resolved after some workaround..

Regards,

Abhishek

0 Kudos
JAIVIN_J_Intel
Employee
1,847 Views

I'm glad that you were able to resolve the issue. Could you please share the workaround? So that it will be helpful for other users in the community.

Regards,

Jaivin

0 Kudos
Munesh_Intel
Moderator
1,847 Views

Hi Abhishek,

Adding on to Jaivin's reply, make sure your environment OpenCV_DIR is pointing to the OpenVINO version of OpenCV (/opt/intel/openvino_2020.2.120/opencv/cmake).

This gets exported by the setupvars script, which sets your environment variables.

If you do not setup for .bashrc script (to permanently set the environment variables), you'll have to setup every time for each terminal.

Regards,

Munesh

0 Kudos
AbhishekD_Intel
Moderator
1,847 Views

Hi Munesh,

Thank you for your help. I was already having OpenCV installed in my environment and OpenVINO also has OpenCV and both were having different versions. So I guess that was the problem.

It got solved now thank you. You can close this thread.

 

Warm Regards,

Abhishek

0 Kudos
Reply