WebGui with 4Borg and OpenCV

When I execute the 4BorgWeb.py to run the WebGUI, I am receiving a module not found cv2 error when importing cv2. When I enter the apt-get command below, I receive dependency issues. Must I also install the OpenCV libraries on Raspian Jessie before executing the apt-get command ?

sudo apt-get -y install libcv-dev libopencv-dev python-opencv

piborg's picture

Have you tried doing an update first:

sudo apt-get update
sudo apt-get -y install libcv-dev libopencv-dev python-opencv

If that does not work could you take a screenshot / photo of the error messages.

The following is the error messages I receive:

pi@raspberrypi:~ $ sudo apt-get -y install libcv-dev libopencv-dev python-opencv
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libcv-dev : Depends: libopencv-objdetect-dev but it is not going to be installed
Depends: libopencv-legacy-dev but it is not going to be installed
libopencv-dev : Depends: libopencv-objdetect-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
Depends: libopencv-highgui-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
Depends: libopencv-legacy-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
Depends: libopencv-contrib-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
Depends: libopencv-videostab-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
Depends: libopencv-superres-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
Depends: libopencv-ocl-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
Depends: libhighgui-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
Depends: libcvaux-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
pi@raspberrypi:~ $

piborg's picture

I have seen this kind of behaviour before when a package had failed to install or was corrupt in some way.

Try these commands to try and fix the existing packages:

sudo apt-get clean
sudo apt-get install -f
sudo dpkg --configure -a
sudo apt-get update

then try the install line again.

If that does not work try forcing an upgrade of the installed packages:

sudo apt-get upgrade -f

I have tried your suggestions and it still fails to install the packages:
login as: pi
pi@192.168.1.10's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Feb 22 12:43:11 2017
pi@raspberrypi:~ $ sudo apt-get clean
pi@raspberrypi:~ $ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~ $ sudo dpkg --configure -a
pi@raspberrypi:~ $ sudo apt-get update
Hit http://mirrordirector.raspbian.org jessie InRelease
Hit http://archive.raspberrypi.org jessie InRelease
Hit http://mirrordirector.raspbian.org jessie/main armhf Packages
Hit http://archive.raspberrypi.org jessie/main armhf Packages
Hit http://mirrordirector.raspbian.org jessie/contrib armhf Packages
Hit http://mirrordirector.raspbian.org jessie/non-free armhf Packages
Hit http://mirrordirector.raspbian.org jessie/rpi armhf Packages
Hit http://archive.raspberrypi.org jessie/ui armhf Packages
Hit http://archive.raspberrypi.org jessie/staging armhf Packages
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_US
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_US
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_US
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_US
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
Ign http://archive.raspberrypi.org jessie/main Translation-en_US
Ign http://archive.raspberrypi.org jessie/main Translation-en
Ign http://archive.raspberrypi.org jessie/staging Translation-en_US
Ign http://archive.raspberrypi.org jessie/staging Translation-en
Ign http://archive.raspberrypi.org jessie/ui Translation-en_US
Ign http://archive.raspberrypi.org jessie/ui Translation-en
Reading package lists... Done
pi@raspberrypi:~ $ sudo apt-get -y install libcv-dev libopencv-dev python-opencvReading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libcv-dev : Depends: libopencv-objdetect-dev but it is not going to be installed
Depends: libopencv-legacy-dev but it is not going to be installed
libopencv-dev : Depends: libopencv-objdetect-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
Depends: libopencv-highgui-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
Depends: libopencv-legacy-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
Depends: libopencv-contrib-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
Depends: libopencv-videostab-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
Depends: libopencv-superres-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
Depends: libopencv-ocl-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
Depends: libhighgui-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
Depends: libcvaux-dev (= 2.4.9.1+dfsg-1+deb8u1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
pi@raspberrypi:~ $ sudo apt-get upgrade -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~ $

piborg's picture

This is rather strange, it seems like something is broken and is not fixable by the normal methods.

What distribution of Linux are you running (e.g. Jessie Lite)?

I am running Raspian Jessie V8. I used a second SD Card to create a new image of Jessie from a NOOBS download. The statement "sudo apt-get -y install libcv-dev libopencv-dev python-opencv" installed successfully. Guess the OS image was in fact corrupted some how. After I reinstall picoborg libraries, I will next execute the 4BorgWeb.py to run the WebGUI and see how it goes. Thanks for your support.

Subscribe to Comments for "WebGui with 4Borg and OpenCV"