1

I'm using the raspberry pi 4 (pip version: pip 22.3.1, python version: 3.9.2) on visual studio code and whenever I enter the command pip install opencv-python in the terminal, after 40 mins I get the error message:

FileNotFoundError: [Errno 2] No such file or directory: '_skbuild/linux-armv7l-3.9/cmake-install/python/cv2/config-3.py' [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for opencv-python Failed to build opencv-python ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects 

I have found a post on the same problem but the suggestion was to upgrade pip and try reinstalling opencv but that hasn't worked either. I'm using python 3.9.2 as an interpreter

When I use the command pip3 install --no-use-pep517 opencv-python I get the error:

error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [6 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/tmp/pip-install-zwr61c7o/opencv-python_1867909748974f69a8333e238206f9df/setup.py", line 10, in import skbuild ModuleNotFoundError: No module named 'skbuild' [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

2 Answers 2

0

Don't fiddle with pip; just run

sudo apt install python3-opencv

which will install the prebuilt wheel

0
0

try by clearing cache and direct install by

  sudo pip install --no-cache-dir opencv-python

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.