OpenCV fails to install on Jetson Nano [closed]

asked 2019-11-03 09:25:06 -0500

TCIII gravatar image

updated 2020-09-05 07:00:29 -0500

I am attempting to install OpenCV on my Jetson Nano following the "Get Your Jestson Nano Working" instructions in the Donkey Car instructions and when I complete the Cmake Setup instructions:

# Create a build directory
cd projects/cv2/opencv

mkdir build

cd build

# Setup CMake

    -D CMAKE_INSTALL_PREFIX=/usr/local \




    # Contrib path
    -D OPENCV_EXTRA_MODULES_PATH=~/projects/cv2/opencv_contrib/modules \

    # Your virtual environment's Python executable
    # You need to specify the result of echo $(which python)
    -D PYTHON_EXECUTABLE=~/env/bin/python \

    -D BUILD_EXAMPLES=ON ../opencv

I get a message saying "CMake Error: The source directory "/home/donkey/projects/cv2/opencv/opencv" does not exist.

Of course it does not exist because "projects/cv2/opencv/" is in the "home" directory and there is no "donkey" directory in the "home" directory. Can anyone tell me what in the Cmake Setup instructions are causing "donkey" directory and the additional "/opencv" to be inserted in the installation path? I suspect that the Cmake Setup "-D CMAKE_INSTALL_PREFIX=/usr/local \" might be causing the problem. Also "-D OPENCV_EXTRA_MODULES_PATH=~/projects/cv2/opencv_contrib/modules \" does not result in an error. Regards, TCIII

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-09-05 07:00:09.384328



I find it easier to use cmake-qt-gui to generate the Makefile... It's easier to set the options and you'll be sure that the paths are set up correctly.

I'm not an expert in command line cmake, but it seems that the specified source path (last parameter) should be .. (or /home/[username]/projects/cv2/opencv) instead of ../opencv.

kbarni gravatar imagekbarni ( 2019-11-04 09:33:07 -0500 )edit

Hi Kbami, Your path correction solution is absolutely correct. A member on the Donkey Car Slack Forum proposed the same solution yesterday and I was able to build and compile my Jetson Nano OpenCV app. Thank you for your solution to my issue.

TCIII gravatar imageTCIII ( 2019-11-04 09:57:00 -0500 )edit