Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. General Questions
  3. help with pip installing opencv

help with pip installing opencv

Scheduled Pinned Locked Moved Unsolved General Questions
2 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Syed OmairS Offline
    Syed OmairS Offline
    Syed Omair
    wrote on last edited by
    #1

    hello,

    i am trying to run this command in my m500 drone "pip3 install opencv-python" inside the provided ubuntu docker container from modal ai. i was able to simply do a pip3 install numpy and pip3 install pandas. but pip3 -v install opencv-python is becoming a very lengthy process taking almost 3 hours before failing with an error. i can understand from the debugger output that it is building the library somehow.

    "ERROR: Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly"

    no matter what I try it won't install. is there an easy solution to get opencv working in the docker container ? i am working with is python 3.5.2 and pip 20.3.4

    i consulted this stackoverflow question for solutions

    https://stackoverflow.com/questions/63732353/error-could-not-build-wheels-for-opencv-python-which-use-pep-517-and-cannot-be

    thank you,
    omair

    Alex KushleyevA 1 Reply Last reply
    0
    • Syed OmairS Syed Omair

      hello,

      i am trying to run this command in my m500 drone "pip3 install opencv-python" inside the provided ubuntu docker container from modal ai. i was able to simply do a pip3 install numpy and pip3 install pandas. but pip3 -v install opencv-python is becoming a very lengthy process taking almost 3 hours before failing with an error. i can understand from the debugger output that it is building the library somehow.

      "ERROR: Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly"

      no matter what I try it won't install. is there an easy solution to get opencv working in the docker container ? i am working with is python 3.5.2 and pip 20.3.4

      i consulted this stackoverflow question for solutions

      https://stackoverflow.com/questions/63732353/error-could-not-build-wheels-for-opencv-python-which-use-pep-517-and-cannot-be

      thank you,
      omair

      Alex KushleyevA Offline
      Alex KushleyevA Offline
      Alex Kushleyev
      ModalAI Team
      wrote on last edited by Alex Kushleyev
      #2

      @Syed-Omair , I suggest that you try building opencv from source - the way we do it is shown here : https://gitlab.com/voxl-public/voxl-sdk/third-party/voxl-opencv/-/tree/add-python3-bindings/ -- this is a specific branch that enables python3 bindings.

      I actually have pre-build deb for this here. This was built and tested for VOXL2, but it should work on VOXL1 in a 64-bit ubuntu docker image. Just before installing the deb, please create the following directory:

      mkdir -p /usr/lib/python3.6/dist-packages/
      

      this is the place where cv2.so will be copied for python to use. I fixed this on the branch but the deb was built some time ago and does not have this fix, so it will fail during install unless you create this folder.

      You should remove (or just don't install) other opencv packages before you install this one.

      Please try it out and let me know if it works for you. Also, if you want to build it yourself, you can see build.sh for build flags, etc. This is a somewhat stripped down version opencv. Building all of the components would indeed take hours on voxl.

      EDIT: the deb i provided may or may not work on VOXL1. The way it was built was actually on an ARM-based Mac inside a ubuntu arm docker, using native compiler flags. So i am not sure if it is compatible with armv8 or needs newer arch. However, you should give it a try. if the deb does not work for you, you can just try building this right on your VOXL1 inside docker using build.sh native option.

      Alex

      1 Reply Last reply
      0
      • Alex KushleyevA Alex Kushleyev referenced this topic on

      Reading along? Create a free ModalAI Forum account to join in.

      With an account you can reply, ask your own question, get an email when a ModalAI engineer answers, and mark the reply that solved it. Your place in each thread is saved between visits.

      Questions about VOXL, Flight Core, ESCs and ModalAI drones are answered here by the engineers who build them.

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      ModalAI
      Categories Recent Tags ModalAI.com Docs
      © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups