Article ID: 000091786 Content Type: Troubleshooting Last Reviewed: 02/17/2023

Unable to Run OpenCV* in OpenVINO™ Docker

BUILT IN - ARTICLE INTRO SECOND COMPONENT
Summary

Provides information about Python* OpenCV* installation

Description
  • Ran the command:

    docker run -ditu root:root --name=openvino -h "openvino" --privileged \
    --device /dev/dri:/dev/dri \
    -v /docker-share/public:/public \
    openvino/ubuntu20_dev:latest

  • Used a Python* inferencing script that contains OpenCV* function.

    cv2.VideoCapture return (false, none)

Resolution
  • Check whether the system really had installed the OpenCV*: pip show opencv or pip show opencv-python
  • Install the OpenCV*: pip install opencv-python
  • Or using Linux*, run the command:

    sudo apt update
    sudo apt install python3-opencv

  • Verify the OpenCV* installation:

    python3 -c "import cv2; print(cv2.__version__)"

Related Products

This article applies to 1 products