Using OpenCV in Python - but in virtual environment?

Hello there,

I want to use the cv2-module in Python whih the Jetson Nano has preinstalled. I can import it and check the version as well.
The problem is I need it within a virtual environment where the module isn’t found. Since I was not able to find any approporate solution for the problem, I would be very glad if someone could help me out.
I tried following command that I found:

cmake -D WITH_CUDA=ON -D CUDA_ARCH_BIN="5.3" -D CUDA_ARCH_PTX="" -D WITH_GSTREAMER=ON -D WITH_LIBV4L=ON -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_EXAMPLES=ON -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_PYTHON_EXAMPLES=ON -D INSTALL_C_EXAMPLES=OFF  -D OPENCV_EXTRA_MODULES_PATH=/home/nvidia/opencv_contrib-3.4.6/modules  -D PYTHON3_EXECUTABLE=/home/nvidia/venv/bin/python PYTHON3_NUMPY_INCLUDE_DIRS=/home/nvidia/venv/lib/python3.6/site-packages/numpy/core/include/ BUILD_opencv_python3=yes -D PYTHON_PACKAGES_PATH=~/home/nvidia/venv/lib/python3.6/site-packages/ -D PYTHON_LIBRARY=/usr/lib/aarch64-linux-gnu/  ..

But this did not work and gave this error:

CMake Error: The source directory "/home" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

Any idea what could go wrong?

Thanks for the answers in advance!

I am not sure, but the guess is.

You are in /home/nvidia/opencv-3.4.6 folder but you should be in /home/nvidia/build-opencv-3.4.6 and the last .. should be ../opencv-3.4.6

On more serious note please use 3.4.8 version so you do not have to patch system cuda libraries and it fixes build
Just to clarify when you use cmake you need to invoke it from build folder (you need to mkdir one) and the last argument needs to point to the source code