Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building wheel taking an extremely long time #923

Open
3 of 4 tasks
charliehoward opened this issue Nov 29, 2023 · 5 comments
Open
3 of 4 tasks

Building wheel taking an extremely long time #923

charliehoward opened this issue Nov 29, 2023 · 5 comments
Labels

Comments

@charliehoward
Copy link

charliehoward commented Nov 29, 2023

Expected behaviour

For it to install quickly.

Actual behaviour

If you run pip3 install opencv-python the installation appears to get stuck at Building wheel for opencv-python. I left it for about an hour with no visible progress.
I've since run pip3 install opencv-python --verbose and as of writing I'm an hour in at 28%.

Steps to reproduce

  • See above
  • Raspberry Pi OS Bullseye
  • ARM
  • 4.8.1.78
Issue submission checklist
  • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
  • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
  • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
  • I'm using the latest version of opencv-python
@charliehoward
Copy link
Author

It's been about 3/4 hours now and it's at 100% but it's been stuck on [100%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o for about 20 minutes, think I'm going to give up. Any ideas on a fix?

@skvark
Copy link
Member

skvark commented Dec 12, 2023

It takes several hours to build OpenCV on RPi. Nothing unusual there.

@charliehoward
Copy link
Author

Yeah not 10+

@Only1leddy
Copy link

Im trying to compile opencv on a pi zero, iv done it with a very lite setup before, it took 8hours but worked, if youn think it's crash just leave it takes AGES so now im trying to use a setup for ml and object detection. So currently it been compiling for 24hours and is at 34percent 👐🧘‍♂️ so im looking at a few more days 😅 strap in

@twelho
Copy link

twelho commented Mar 8, 2025

Try running export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) before pip install opencv-python. This makes the cmake --build invocation of opencv-python use all cores, and enabled me to build it in minutes instead of hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants