How to install `cv2` correctly for `Raspbian Jessie`? - opencv

When I tried to install opencv2 in python 3.4.2 in rasbian jessie, the following error occured.
pip3 install python3-opencv
Collecting python3-opencv
Could not find a version that satisfies the requirement python3-opencv (from versions: )
No matching distribution found for python3-opencv
I have also tried:
sudo apt-get install python3-opencv
It also shows the same error.

Related

OpenCV error zlib.h: no such file or directory

I am trying to follow this website to install opencv4 on Ubuntu 18.04.
https://www.learnopencv.com/install-opencv-4-on-ubuntu-18-04/
But I get this error after make
In file included from /home/gosztolai/opencv/3rdparty/libpng/pngpriv.h:913:0,
from /home/gosztolai/opencv/3rdparty/libpng/png.c:14:
/home/gosztolai/opencv/3rdparty/libpng/pngstruct.h:30:10: fatal error: zlib.h: No such file or directory
#include "zlib.h"
I tried sudo apt install zlib1g-dev but the system says that it is already isntalled
Could someone help what is going on?
libpng uses the zlib library for image compression. To install it in Ubuntu, run the following code in your bash terminal:
sudo apt-get install zlib1g-dev
But because you already have it installed, and need a newer version, you need to update the library. Try to upgrade your packages, using this code:
sudo apt update
sudo apt upgrade -y
Or you can try to remove it using apt and install again.

Nvidia 9.2 CUDA toolkit nvcc install error

I am trying to install the CUDA toolkit on Ubuntu 16.04 with
sudo apt-get install cuda
and keep getting the following error:
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:
cuda : Depends: cuda-9-2 (>= 9.2.148) but it is not going to be
installed
E: Unable to correct problems, you have held broken packages
any help?
Option 1:
sudo apt-get install cuda-runtime-9-2
sudo apt-get install cuda-9-2
sudo apt-get install cuda
Option 2:
sudo apt-get install aptitude
sudo aptitude install cuda

ros kinetic install Failed to process package 'opencv3'

I am installing ros-kinetic on arch following these instructions:
https://gist.github.com/lcpz/0ab75aa5205504ced9f5c11cac10a89e
Everything was fine until step 9 where I got the following error:
make: *** [Makefile:163: all] Error 2
<== Failed to process package 'opencv3':
Command '['/opt/ros/kinetic/env.sh', 'make', '-j4', '-l4']' returned non-zero exit status 2
Reproduce this error by running:
==> cd /home/rashik/ros/ros_catkin_ws/build_isolated/opencv3 && /opt/ros/kinetic/env.sh make -j4 -l4
Why did that happen?
Check if all prerequisites are installed first:
sudo apt install build-essential
sudo apt install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
Of course, adjust the commands for your system(I'm unfamiliar with pacman).
After that, if it doesn't solve an issue try running make without "-j" option - it can, in rare cases, cause issues especially when you're building dependencies for packages you're building in the same build.
If that doesn't work, try installing OpenCV separately and check if you can get it installed that way. It's possible that a library is failing to link or something - it will probably be clearer if you get the same error separately from entire ROS build. Installation instructions for OpenCV can be found here: https://docs.opencv.org/3.0-beta/doc/tutorials/introduction/linux_install/linux_install.html

Can't locate 'hdf5.h' during test

I tried to install the HDF5 library. I followed this guide Install_HDF5. In particular, I used:
sudo apt-get install libhdf5-serial-dev
sudo apt-get install libhdf5-mpich-dev
sudo apt-get install libhdf5-openmpi-dev
Up to this moment all the installations were successful. I tried to test it (make test) still following the guide, but I get:
fatal error hdf5.h no such file or directory
Could it concern a problem with my ~/.bashrc, i.e. with some missing path to hdf5?
P.S. I tested the Python module of HDF5 and it is working. I only received a warning message that I got rid of by using:
sudo python2.7 -m pip install git+https:://github.com/h5py/h5py.git --upgrade

Problems installing scikit-image in ubuntu 14.04

When I try to install scikit-image with pip2 there is show error. I have tried to find this problem solution.
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/scikit-image
Storing debug log for failure in /home/nshakib/.pip/pip.log
My guess is that you might have missing dependencies. I don't think Ubuntu 14.04 comes out of the box with any of the SciPy stack.
To answer your question try,
sudo apt-get install python-matplotlib python-numpy python-pil python-scipy
Then
sudo apt-get install build-essential cython
Finally
sudo apt-get install python-skimage
If that still doesn't work, you could try using the Anaconda Distribution for Python 2.7 from Continuum Analytics.
It comes with many of the major packages built-in and has a great package manager that manages dependencies.
https://docs.continuum.io/anaconda/install#anaconda-install
The conda package would be installed with conda install scikit-image

Resources