OpenCV problem downgrading openCV 4.1.1 to openCV 3.3.1

Hi everyone!
I got a Problem with my Version of openCV. I am running Python 3.6.9 and after uninstalling python3-openCV I am left with opencv 4.1.1. I wouldn’t bother, but I am getting error messages in VS-Code regarding my imports. None of the functions of cv2 are recognized and are marked as error. e.g. “Module ‘cv2’ has no ‘VideoCapture’ member…” . Never the less it is compiling and running, when I insert a shebang that points to python3. How do I get opencv-4.1.1 downgraded to opencv 3.3.1 to avoid these conflicts while following these lessons?

Here Paul describes how to first install python3-openCV then uninstall it, and he is left with openCV 3.3.1. I tried that and was left with openCV 4.1.1. My IDE (VSCode) doesn’t recognize the imported cv2 and it’s functions. It works when I am running the file, but just because of the shebang that points to python3.

How do I uninstall Opencv completely and install just the right version e.g. 3.3.1??

Maybe someone can Help, I’m pretty stuck here. Thanks and cheers to all!! :-)

Andy

Weniger anzeigen

ANTWORTEN

Hi,

I am not an expert of openCV but there are something I want to clarify.

  1. I assume you have opencv4.1.1 because you install the sdk from jetpack.

  2. It sounds like some library links have been removed after you removed python3-opencv.

  3. Does this issue happen to your IDE only or even “import cv2” gets error in python3 command line?

  4. Why not just installing opencv3.3.1 from the beginning and does not install the opencv from our sdk?

  5. You can also check what opencv libs are/can be installed on your board by the command. And you can also remove them by using apt command. Please note that this only removes the one installed by apt. If you build and install it from source, then it will probably not be removed.

nvidia@nvidia-desktop:~$ sudo apt list |grep -i openCV

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

cl-opencv-apps/bionic 1.11.14-1build4 all
gstreamer1.0-opencv/bionic-updates 1.14.5-0ubuntu1~18.04.1 arm64
libgstreamer-opencv1.0-0/bionic-updates 1.14.5-0ubuntu1~18.04.1 arm64
libopencv/stable,now 4.1.1-2-gd5a58aa75 arm64 [installed]
libopencv-apps-dev/bionic 1.11.14-1build4 arm64
libopencv-apps0d/bionic 1.11.14-1build4 arm64
libopencv-calib3d-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-calib3d3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-contrib-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-contrib3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-core-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-core3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-dev/stable,now 4.1.1-2-gd5a58aa75 arm64 [installed]
libopencv-features2d-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-features2d3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-flann-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-flann3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-highgui-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-highgui3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-imgcodecs-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-imgcodecs3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-imgproc-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-imgproc3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-ml-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-ml3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-objdetect-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-objdetect3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-photo-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-photo3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-python/stable,now 4.1.1-2-gd5a58aa75 arm64 [installed]
libopencv-samples/stable,now 4.1.1-2-gd5a58aa75 arm64 [installed]
libopencv-shape-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-shape3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-stitching-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-stitching3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-superres-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-superres3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-ts-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-video-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-video3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-videoio-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-videoio3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-videostab-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-videostab3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-viz-dev/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv-viz3.2/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
libopencv3.2-java/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 all
libopencv3.2-jni/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
nvidia-opencv/stable 4.4.1-b50 arm64
opencv-data/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 all
opencv-doc/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 all
opencv-licenses/stable,now 4.1.1-2-gd5a58aa75 arm64 [installed]
python-opencv/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
python-opencv-apps/bionic 1.11.14-1build4 all
python3-opencv/bionic-updates,bionic-security 3.2.0+dfsg-4ubuntu0.1 arm64
ros-opencv-apps/bionic 1.11.14-1build4 arm64

How to install Opencv-4.4.1 in Jetson Xavier nx with jetpack 4.4

How to install Opencv-4.4.1 in Jetson Xavier nx with jetpack 4.4