title: OpenCV 4.1 with CUDA in python uses wrong OpenCV version
body: <p>I'm trying to install opencv 4.1 to use in python WITH Cuda support. I tried following <a href="https://gist.github.com/raulqf/f42c718a658cddc16f9df07ecc627be7" rel="nofollow noreferrer">this guide</a> and had preinstalled CUDA 10 (because I needed it with keras and this works already), but when checking opencv in python using following code</p>
  
  <pre><code>import cv2 as cv
  
  print(cv.__version__)
  print(cv.getBuildInformation())
  </code></pre>
  
  <p>But it returns the wrong open cv version AND unavailable cuda libraries:</p>
  
  <pre><code>3.2.0
  
  General configuration for OpenCV 3.2.0 =====================================
    Version control:               unknown
  
    Extra modules:
      Location (extra):            /build/opencv-L2vuMj/opencv-3.2.0+dfsg/contrib/modules
      Version control (extra):     unknown
  
    Platform:
      Timestamp:                   2018-09-20T09:28:13Z
      Host:                        Linux 4.4.0-135-generic x86_64
      CMake:                       3.10.2
      CMake generator:             Unix Makefiles
      CMake build tool:            /usr/bin/make
      Configuration:               Release
  
    C/C++:
      Built as dynamic libs?:      YES
      C++ Compiler:                /usr/bin/c++  (ver 7.3.0)
      C++ flags (Release):         -g -O2 -fdebug-prefix-map=/build/opencv-L2vuMj/opencv-3.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -mno-sse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O2 -fdebug-prefix-map=/build/opencv-L2vuMj/opencv-3.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security  -DNDEBUG
      C++ flags (Debug):           -g -O2 -fdebug-prefix-map=/build/opencv-L2vuMj/opencv-3.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -mno-sse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
      C Compiler:                  /usr/bin/cc
      C flags (Release):           -g -O2 -fdebug-prefix-map=/build/opencv-L2vuMj/opencv-3.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -mno-sse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -g -O2 -fdebug-prefix-map=/build/opencv-L2vuMj/opencv-3.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security  -DNDEBUG
      C flags (Debug):             -g -O2 -fdebug-prefix-map=/build/opencv-L2vuMj/opencv-3.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -mno-sse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
      Linker flags (Release):      -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now
      Linker flags (Debug):        -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now
      ccache:                      NO
      Precompiled headers:         NO
      Extra dependencies:          /usr/lib/x86_64-linux-gnu/libwebp.so gdcmMSFF /usr/lib/x86_64-linux-gnu/libImath.so /usr/lib/x86_64-linux-gnu/libIlmImf.so /usr/lib/x86_64-linux-gnu/libIex.so /usr/lib/x86_64-linux-gnu/libHalf.so /usr/lib/x86_64-linux-gnu/libIlmThread.so /usr/lib/libgdal.so gtk-3 gdk-3 pangocairo-1.0 pango-1.0 atk-1.0 cairo-gobject cairo gdk_pixbuf-2.0 gio-2.0 gobject-2.0 glib-2.0 gthread-2.0 dc1394 avcodec avformat avutil swscale avresample gphoto2 gphoto2_port /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so /usr/lib/x86_64-linux-gnu/libpthread.so /usr/lib/x86_64-linux-gnu/libsz.so /usr/lib/x86_64-linux-gnu/libdl.so /usr/lib/x86_64-linux-gnu/libm.so vtkRenderingOpenGL vtkImagingHybrid vtkIOImage vtkCommonDataModel vtkCommonMath vtkCommonCore vtksys vtkCommonMisc vtkCommonSystem vtkCommonTransforms vtkCommonExecutionModel vtkDICOMParser vtkIOCore /usr/lib/x86_64-linux-gnu/libz.so vtkmetaio /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/x86_64-linux-gnu/libtiff.so vtkImagingCore vtkRenderingCore vtkCommonColor vtkFiltersExtraction vtkFiltersCore vtkFiltersGeneral vtkCommonComputationalGeometry vtkFiltersStatistics vtkImagingFourier vtkalglib vtkFiltersGeometry vtkFiltersSources vtkInteractionStyle vtkRenderingLOD vtkFiltersModeling vtkIOPLY vtkIOGeometry vtkFiltersTexture vtkRenderingFreeType /usr/lib/x86_64-linux-gnu/libfreetype.so vtkftgl vtkIOExport vtkRenderingAnnotation vtkImagingColor vtkRenderingContext2D vtkRenderingGL2PS vtkRenderingContextOpenGL /usr/lib/x86_64-linux-gnu/libgl2ps.so vtkRenderingLabel tesseract lept dl m pthread rt tbb
      3rdparty dependencies:
  
    OpenCV modules:
      To be built:                 core flann hdf imgproc ml photo reg surface_matching video viz freetype fuzzy imgcodecs shape videoio highgui objdetect plot superres ts xobjdetect xphoto bgsegm bioinspired dpm face features2d line_descriptor saliency text calib3d ccalib datasets rgbd stereo stitching videostab ximgproc aruco optflow phase_unwrapping structured_light java python2 python3
      Disabled:                    world contrib_world
      Disabled by dependency:      tracking
      Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cnn_3dobj cvv dnn matlab sfm
  
    GUI: 
      QT:                          NO
      GTK+ 3.x:                    YES (ver 3.22.30)
      GThread :                    YES (ver 2.56.2)
      GtkGlExt:                    NO
      OpenGL support:              NO
      VTK support:                 YES (ver 6.3.0)
  
    Media I/O: 
      ZLib:                        /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.11)
      JPEG:                        /usr/lib/x86_64-linux-gnu/libjpeg.so (ver )
      WEBP:                        /usr/lib/x86_64-linux-gnu/libwebp.so (ver encoder: 0x020e)
      PNG:                         /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.34)
      TIFF:                        /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 - 4.0.9)
      JPEG 2000:                   NO
      OpenEXR:                     /usr/lib/x86_64-linux-gnu/libImath.so /usr/lib/x86_64-linux-gnu/libIlmImf.so /usr/lib/x86_64-linux-gnu/libIex.so /usr/lib/x86_64-linux-gnu/libHalf.so /usr/lib/x86_64-linux-gnu/libIlmThread.so (ver 2.2.0)
      GDAL:                        /usr/lib/libgdal.so
      GDCM:                        YES (ver 2.8.4)
  
    Video I/O:
      DC1394 1.x:                  NO
      DC1394 2.x:                  YES (ver 2.2.5)
      FFMPEG:                      YES
        avcodec:                   YES (ver 57.107.100)
        avformat:                  YES (ver 57.83.100)
        avutil:                    YES (ver 55.78.100)
        swscale:                   YES (ver 4.8.100)
        avresample:                YES (ver 3.7.0)
      GStreamer:                   NO
      OpenNI:                      NO
      OpenNI PrimeSensor Modules:  NO
      OpenNI2:                     NO
      PvAPI:                       NO
      GigEVisionSDK:               NO
      Aravis SDK:                  NO
      UniCap:                      NO
      UniCap ucil:                 NO
      V4L/V4L2:                    NO/YES
      XIMEA:                       NO
      Xine:                        NO
      gPhoto2:                     YES
  
    Parallel framework:            TBB (ver 2017.0 interface 9107)
  
    Other third-party libraries:
      Use IPP:                     NO
      Use IPP Async:               NO
      Use VA:                      NO
      Use Intel VA-API/OpenCL:     NO
      Use Lapack:                  NO
      Use Eigen:                   YES (ver 3.3.4)
      Use Cuda:                    NO
      Use OpenCL:                  YES
      Use OpenVX:                  NO
      Use custom HAL:              NO
  
    OpenCL:                        &lt;Dynamic loading of OpenCL library&gt;
      Include path:                /usr/include/CL
      Use AMDFFT:                  NO
      Use AMDBLAS:                 NO
  
    Python 2:
      Interpreter:                 /usr/bin/python2.7 (ver 2.7.15)
      Libraries:                   /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.15rc1)
      numpy:                       /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.13.3)
      packages path:               lib/python2.7/dist-packages
  
    Python 3:
      Interpreter:                 /usr/bin/python3 (ver 3.6.5)
      Libraries:                   /usr/lib/x86_64-linux-gnu/libpython3.6m.so (ver 3.6.5)
      numpy:                       /usr/lib/python3/dist-packages/numpy/core/include (ver 1.13.3)
      packages path:               lib/python3.6/dist-packages
  
    Python (for build):            /usr/bin/python2.7
  
    Java:
      ant:                         /usr/bin/ant (ver 1.10.3)
      JNI:                         /usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include/linux /usr/lib/jvm/default-java/include
      Java wrappers:               YES
      Java tests:                  NO
  
    Matlab:                        Matlab not found or implicitly disabled
  
    Documentation:
      Doxygen:                     /usr/bin/doxygen (ver 1.8.13)
  
    Tests and samples:
      Tests:                       NO
      Performance tests:           YES
      C/C++ Examples:              YES
  
    Install path:                  /usr
  
    cvconfig.h is in:              /build/opencv-L2vuMj/opencv-3.2.0+dfsg/obj-x86_64-linux-gnu
  -----------------------------------------------------------------
  </code></pre>
  
  <p>Altough in cmake-gui when generating the cmake, cuda WAS enabled and opencv was effectively version 4.1.</p>
  
  <p>Any ideas? Thanks in advance!</p>
  
  <p>PS. I didn't use pip to install opencv, but I built it from source</p>