I created venv with python3.6 version on Jetson orin device and tried to build opencv with cuda, but I could not succeed. I am sharing the build frags and the output with you, and I don’t get any errors in the installation, I can’t see the gpu in venv.
#!/bin/bash # # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # NVIDIA Corporation and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and related documentation without an express # license agreement from NVIDIA Corporation is strictly prohibited. #
version=“4.5.3” folder=“workspace”
set -e
for (( ; ; )) do
** echo “Do you want to remove the default OpenCV (yes/no)?”**
** read rm_old**
Hello, i try with this script and i changed echo path for my venv pyhon path but it doesnt work. Opencv didnt install, i try install with this script. Do I need to install opencv first with pip install opencv-python==4.5.3?
I found now my fault echo ‘export PYTHONPATH=/home/jetson-orin/Headlamp/lib/python3.6/site-packages/site-packages/:$PYTHONPATH’ >> ~/.bashrc i wrote site-packages twice than i fixed and i am trying now again. But i have a question, is it correct this script for opencv build and install for venv?
Did you build it within or outside the env?
If you build it outside of the env, please remember to add --system-site-packages when creating the virtual environment.
I will tell step by step
1-) I installed jetpack 5.0.2 version on my orin device and install python3.6(default python version is 3.8)
2-) I create venv with like this command virtualenv --python=python3.6 name --system-site-packages
3-) I use this souce JEP/install_opencv4.6.0_Jetson.sh at master · AastaNV/JEP · GitHub (but i change opencv version to 4.5.3 and also i change export paths like upside)
4-) Build was succesful but i cant import cv2 when i try in venv, every time build for python2.7
5-) I close opencv build for python2 with flag but still build for python2.7 :), i use opencv with gpu from python2.7
6-)So i dont build opencv for python3
When I install python3.6, opencv is not installed compared to other python versionsa and I create the virtual environment directly.
$ python3
Python 3.6.15 (default, Apr 25 2022, 01:55:53)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'4.5.3'