-
Notifications
You must be signed in to change notification settings - Fork 891
ERROR: Failed building wheel for opencv-python: [ FileNotFoundError: [Errno 2] No such file or directory: '_skbuild/linux-armv7l-3.9/cmake-install/python/cv2/config-3.py' ] #814
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
Comments
I had the same problem. Try it "sudo apt install python3-opencv" |
Hi billni, thanks for your answer. I've tried that as well, but that installs it globally and not in my virtual environment. |
It looks like I was able to reproduce the issue with my Pi 3b. Will take a look if I can propose some workaround before the next release. |
Cheers, much looking forward to this |
config-XXX.py is named differently depending on LIMITED_API option. https://github.com/opencv/opencv/blob/4.x/modules/python/common.cmake#L210 |
Thank you very much. So its simply pip3 install opencv-python -DPYTHON3_LIMITED_API=ON --verbose Or is that completely wrong? |
Use environment variable |
Fixed in #820 |
Its still coming up with the error? |
I can see your little eyes looking! When you said fixed I presumed I would just run the install again and it should work?! A little more help is needed please, Alexander @asmorkalov :) I have spent weeks trying to get OpenCV working and every guide I have tried has failed! I don't see how it's so bloody hard to install?! All I'm looking to do is run the NDVI script using my RPI 3B+ and NOIR V3 camera! I don't know if it helps but I could instal OpenCV on my Unraid server and have the feed from the Pi go there and the server does all the hard work. At the end of the day, my server is running Home Assistant in a VM but I need the Pi's NOIR camera with the blue filter over the lens. |
Obviously, the new version that would include the bug fix hasn't been released to the Python package index since the fix was just merged into this repository. You'll have to wait for a new release, or clone this repository and do a manual build. |
PHmm, I think I can clone this one and do it. Numpy, picamera and flask is already installed so will try cloning this and installing…Kind regards,JamieOn 17 Mar 2023, at 14:26, Olli-Pekka Heinisuo ***@***.***> wrote:
Obviously, the new version that would include the bug fix hasn't been released to the Python package index since the fix was just merged into this repository. You'll have to wait for a new release, or clone this repository and do a manual build.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Thanks for the fix @asmorkalov ! Thanks in advance! |
Rolling releases are broken for today. I'm working on it right now. I'll let you know, when you can try. |
Any update? @asmorkalov Cheers |
I had no luck with #820, but pinning the scikit-build version in --- "scikit-build>=0.13.2",
+++ "scikit-build==0.17.1", I tested 0.17.2 and it fails with
This was fixed in 0.17.3, but there seems to be some other change in there that's breaking things. Is there any reason to not pin this version for the builds? |
This build failure is still present with python3.11. It appears to be caused by #835 — the incompatible numpy version apparently disables the python bindings since I can see that "install path" is omitted from the cmake version string no matter the value of -DCMAKE_PYTHON3_INSTALL_PATH. Updating numpy to a compatible version allowed me to build a wheel with 3.11. CI doesn't have this issue because of the TEST_DEP_LATEST override. Should be fixed by #839. |
The issue closed. OpenCV-Python 4.8.0 with the issue fix will be release in a couple of days. |
@asmorkalov FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install --no-install-recommends -y build-essential gcc software-properties-common curl && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get install --no-install-recommends -y python3.10 python3.10-dev python3-pip python3-setuptools python3.10-distutils python3.10-venv
WORKDIR /venv
RUN python3.10 -m venv /venv
ENV PATH="/venv/bin:$PATH"
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
RUN pip3.10 install --upgrade pip
RUN python3.10 -m pip install --upgrade wheel setuptools requests
ENV OPENCV_VERSION=4.8.1
RUN apt-get install -y \
cmake \
libjack-jackd2-dev \
libmp3lame-dev \
libopencore-amrnb-dev \
libopencore-amrwb-dev \
libsdl1.2-dev \
libtheora-dev \
libva-dev \
libvdpau-dev \
libvorbis-dev \
libx11-dev \
libxfixes-dev \
libxvidcore-dev \
texi2html \
zlib1g-dev \
wget \
unzip \
yasm \
pkg-config \
libswscale-dev \
libtbb2 \
libtbb-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libavformat-dev \
libpq-dev \
x264 \
libx264-dev \
ffmpeg \
git
WORKDIR /opencv
RUN wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
unzip ${OPENCV_VERSION}.zip && \
mkdir opencv-${OPENCV_VERSION}/build
WORKDIR /opencv/opencv-${OPENCV_VERSION}/build
RUN cmake \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D BUILD_TESTS=OFF \
-D BUILD_PERF_TESTS=OFF \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D BUILD_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=OFF \
-D INSTALL_C_EXAMPLES=OFF \
-D BUILD_opencv_python2=OFF \
-D BUILD_opencv_python3=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D OPENCV_PC_FILE_NAME=opencv.pc \
-D PYTHON_EXECUTABLE=/usr/bin/python3.10 \
-D OPENCV_PYTHON3_INSTALL_PATH=/venv/lib/python3.10/site-packages \
-D BUILD_opencv_java=OFF \
-D WITH_CUDA=OFF \
-D WITH_CUDNN=OFF \
-D WITH_OPENCL=OFF \
-D WITH_OPENMP=OFF \
-D WITH_TBB=OFF \
-D WITH_IPP=OFF \
-D WITH_1394=OFF \
-D WITH_FFMPEG=ON \
-D WITH_GSTREAMER=OFF \
-D WITH_GSTREAMER_0_10=OFF \
-D WITH_GTK=OFF \
-D WITH_JASPER=OFF \
-D WITH_JPEG=ON \
-D WITH_OPENEXR=OFF \
-D WITH_PNG=ON \
-D WITH_TIFF=ON \
-D WITH_WEBP=OFF \
-D WITH_V4L=OFF \
-D WITH_VTK=OFF \
-D WITH_EIGEN=OFF \
-D WITH_PROTOBUF=OFF \
-D WITH_GDCM=OFF \
-D WITH_OPENJPEG=OFF \
-D WITH_OPENNI=OFF \
-D WITH_OPENNI2=OFF \
-D WITH_PVAPI=OFF \
-D WITH_ARAVIS=OFF \
-D WITH_GIGEAPI=OFF \
-D WITH_QT=OFF \
-D WITH_OPENGL=OFF \
-D CMAKE_BUILD_TYPE=RELEASE \
-D BUILD_NEW_PYTHON_SUPPORT=ON \
-D HAVE_opencv_python3=ON \
-D BUILD_opencv_gapi=ON \
-D PYTHON3_LIMITED_API=ON \
.. \
&& make -j$(nproc) \
&& make install
WORKDIR /opencv
RUN git clone https://github.com/opencv/opencv-python.git
WORKDIR /opencv/opencv-python
RUN python3.10 -m pip install scikit-build
RUN python3.10 setup.py bdist_wheel Build output:
|
This worked for me |
It's bad idea. The command installs yet another OpenCV-Python instance of some old version provided by Linux distribution. Doing that you get a salad of several instances of OpenCV that is loaded in inpredictable order. You can switch to distro-provided OpenCV Python, but all other instanced should be removed first. |
Anyway that didn't help |
How did you solve your problem? I encountered similar issue on RPi 4B FileNotFoundError: [Errno 2] No such file or directory: '_skbuild/linux-aarch64-3.9/cmake-install/python/cv2/config-3.py'
error: subprocess-exited-with-error
× Building wheel for opencv-python (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /usr/bin/python3 /home/pbs/.local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmp8g9__46_
cwd: /tmp/pip-install-vlokyin2/opencv-python_82696fa637964183835fb00d04c812e9
Building wheel for opencv-python (pyproject.toml) ... error
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 |
Probably, I installed numpy before running setup.py. |
Thank you for your reply! The Dockerfile looks not much different from #814 (comment) Did you find the reason of this error message? Traceback (most recent call last):
File "/opencv/opencv-python/setup.py", line 535, in <module>
main()
File "/opencv/opencv-python/setup.py", line 267, in main
skbuild.setup(
File "/venv/lib/python3.10/site-packages/skbuild/setuptools_wrap.py", line 706, in setup
_classify_installed_files(
File "/opencv/opencv-python/setup.py", line 409, in _classify_installed_files_override
with open(config_py, 'w') as opencv_init_config:
FileNotFoundError: [Errno 2] No such file or directory: '_skbuild/linux-x86_64-3.10/cmake-install/python/cv2/config-3.py' |
Ah I see. you said installing numpy before running setup.py |
Have I missed it, it there a solution to this problem? All I am wanting is to install DVR-Scan on a headless Pi. |
I resolved the issue with building opencv-python source manually. (latest release one) |
ChanJoon, thank you for your suggestion.
Using instructions on this site: and after installing the prerequisites I used this command: I know that this thread is not about DVR-Scan but to install it I then used: Progress at least. |
We had this issue recently and found it was due to cmake not creating the opencv python library
make sure that
For me the fix was just to install numpy first. Change the Dockerfile in #814 (comment) to install it before build: - RUN python3.10 -m pip install scikit-build
+ RUN python3.10 -m pip install scikit-build numpy |
Was this supposed to be fixed? I'm still getting the exact same fail signature as in the subject line with opencv-python-headless 4.9 and 4.8 and Raspbian Bullseye. |
consider installing python3-dev or python3-devel using yum it worked for me with opencv-python-headless when it cant build wheel |
Hrm, nope.
6 hours later...
Pretty much always the same thing; this was with 4.9.0.80. |
I also have the same error. I am trying to install it on raspberry pi 3 |
Having the same error while build armv7 with docker |
Same problem building it in a docker buildx crosscompiling to arm/v7 and compiling in a raspberry directly. |
Has anyone managed to get this working? I'm having the same issue on my raspberry pi |
Have the same problem on raspberry pi 5 |
try this. pip install numpy==1.23.5 |
I was able to install OpenCV on a RaspberryPi 3B+ on Bullseye using the process described here: |
I had a similar Problem on my Raspberry Pi 4. For me the numpy installation missed some requirements. I could install numpy with pip but when i tried to import numpy in a python file i did get an error that told me "libopenblas.so.0: cannot open shared object file: No such file or directory". So i installed it via "sudo apt-get install libopenblas-dev". After that i installed numpy with pip and then the build worked for me |
Expected behaviour
I tried to install opencv-python in my virtual environment and was expecting the opencv-python library v4.7.0.72 to be installed succesfully.
Even after multiple tries and trying different solutions/workarounds found online, nothing seems to help.
Actual behaviour
The build runs for +-3 hours, goes to 100% and then later on fails during installation phase of the project.
Following error is being returned:
FileNotFoundError: [Errno 2] No such file or directory: '_skbuild/linux-armv7l-3.9/cmake-install/python/cv2/config-3.py'
error: subprocess-exited-with-error
Steps to reproduce
result
result
System
What I've tried so far
The text was updated successfully, but these errors were encountered: