Qengineering / Install-OpenCV-Jetson-Nano

OpenCV installation script with CUDA and cuDNN support
https://qengineering.eu/install-opencv-on-jetson-nano.html
BSD 3-Clause "New" or "Revised" License
137 stars 47 forks source link

CV installation.'.format(fnames)) ImportError: OpenCV loader: missing configuration file: ['config-3.6.py', 'config-3.py']. Check OpenCV installation. #16

Closed arielkantorovich closed 8 months ago

arielkantorovich commented 8 months ago

Hi, I using OpenCv-4-8-0 on my jetson nano. It's look like the install sucssed, When I look on JTop I see YES on opencv4.8.0 . but, when I try import opencv I get this error Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/uvision/VitTracker/lib/python3.6/site-packages/cv2/__init__.py", line 181, in <module> bootstrap() File "/home/uvision/VitTracker/lib/python3.6/site-packages/cv2/__init__.py", line 115, in bootstrap ], True) File "/home/uvision/VitTracker/lib/python3.6/site-packages/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.6.py', 'config-3.py']. Check OpenCV installation. When I run python from directory /usr/lib/python3.6/dist-packages/cv2/python-3.6 I sussed but then opencv is in version 4.1.1. I don't understand what I miss, I will happy to any help.

Qengineering commented 8 months ago

Not sure what you are doing. You don't need to run opencv from the /usr/lib/python3.6/dist-packages/cv2/python-3.6 folder. After the installation just run it like the screen dump below. image

arielkantorovich commented 8 months ago

I know, but when I try to import opencv I get this error. Maybe there is a connection to venv? because after I compile opencv I try open new venv with python 3.6.9 and pip3 install /path_to_build_folder/python_loader I see in pip3 list opencv 4.8.0 but again when I try import cv2 I get: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/uvision/VitTracker/lib/python3.6/site-packages/cv2/__init__.py", line 181, in <module> bootstrap() File "/home/uvision/VitTracker/lib/python3.6/site-packages/cv2/__init__.py", line 115, in bootstrap ], True) File "/home/uvision/VitTracker/lib/python3.6/site-packages/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.6.py', 'config-3.py']. Check OpenCV installation

Qengineering commented 8 months ago

I think you have to install OpenCV in your virtual environment. At the moment your installation is system-wide.

arielkantorovich commented 8 months ago

I install opencv where I connected to my venv,

Qengineering commented 8 months ago

When creating your virtual environment, please add --system-site-packages in the command. Screenshot from 2023-11-16 13-10-27

arielkantorovich commented 8 months ago

I install opencv again not from your script using your guida and it's work with pip3 install /bath to build/python_loader. still thank you for your help.