Skip to content

ImportError: OpenCV loader: missing configuration file #1039

Closed
@arielkantorovich

Description

@arielkantorovich

Environment

WSL2 - Ubuntu 22.04
miniconda env with python 3.10 version
Opencv version 4.10

Steps to reproduce

I try to compile Opencv with CUDA on my wsl2 machine. here is my Cmake file list:
cmake
-D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=/usr/local
-D WITH_CUDA=ON
-D WITH_CUDNN=ON
-D WITH_CUBLAS=ON
-D WITH_TBB=ON
-D OPENCV_DNN_CUDA=ON
-D OPENCV_ENABLE_NONFREE=ON
-D WITH_GSTREAMER=ON
-D WITH_V4L=ON
-D WITH_LIBV4L=ON
-D CUDA_ARCH_BIN=8.6
-D OPENCV_EXTRA_MODULES_PATH=$HOME/opencv_contrib/modules
-D BUILD_EXAMPLES=OFF
-D HAVE_opencv_python3=ON
..

Succeed to compile and finish.
Succeed to install on conda env using pip3 install opencv/build/python_loader

Issue

Try import cv2 from python and get the following error:

import cv2 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/arielka/opencv/build/python_loader/cv2/__init__.py", line 181, in <module> bootstrap() File "/home/arielka/opencv/build/python_loader/cv2/__init__.py", line 112, in bootstrap load_first_config([ File "/home/arielka/opencv/build/python_loader/cv2/__init__.py", line 109, in load_first_config raise ImportError('OpenCV loader: missing configuration file: {}. Check OpenCV installation.'.format(fnames)) ImportError: OpenCV loader: missing configuration file: ['config-3.10.py', 'config-3.py']. Check OpenCV installation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions