Install packages from PYPI in Raspberry Pi - opencv

I want to install a precompiled version of OpenCV 3.4.2 in the Raspberry using the following commands:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install pip3
sudo pip3 install opencv-python
But it failed and the error message was: "Could not find a version that satisfies the requirement opencv-python (from versions: ) No matching distribution found for opencv-python"
Then tried the following commands but the result was the same:
sudo apt-get install python3-pip
sudo pip install opencv-python
I had not problems installing it on my PC with ubuntu 16 using the same commands. This is the page im using for reference https://pypi.org/project/opencv-python/
I'm using Raspbian Jessie Lite, Python 3.4

The list of downloadable files for opencv includes binary wheels for many Python versions but for limited set of architectures: MacOSX on Intel, Linux on Intel 32 and 64 bits, Windows on Intel 32 and 64 bits. Raspberry Pi processors absent and there is no source code so pip cannot compile it.
The FAQ recommends to look up Pi wheels at https://www.piwheels.org/.

Related

Building Darknet: Installing OpenCV for CUDA

I'm having trouble building Darknet with the configuration:
GPU=1
CUDNN=1
CUDNN_HALF=0
OPENCV=1
The error when running the Makefile is:
/usr/include/opencv4/opencv2/stitching/detail/warpers.hpp:47:10: fatal error: opencv2/core/cuda.hpp: No such file or directory 47 |
#include "opencv2/core/cuda.hpp"
I have installed cuda-11.2 and cudann successfully, and verified the installations.
I have tried running sudo apt install libopencv-dev and this was up-to-date.
My setup is:
os: Ubuntu 20.04
cuda version: 11.2
cudann version: 8.1
Can anyone help me install OpenCV such that I can build darknet with OpenCV?
I was able to solve the issue by running:
sudo apt-get purge --auto-remove libopencv-dev
which purged the package, along with any dependencies required for the package. I then reinstalled the package by running:
sudo apt install libopencv-dev
and Darknet then built without error.

ModuleNotFoundError: No module named 'cv2' in google coral mendel 4.0

https://coral.withgoogle.com/news/updates-11-2019/
As per above google coral November updates new Mendel 4.0 has the support of OpenCV but when I installed Mendel 4.0 it is unable to import cv2. Please let me know do I've to follow any further steps to install OpenCV in Mendel 4.0
Following steps have to be done:
If you have a fresh image make sure you update your system packages
sudo apt-get update
sudo apt-get dist-upgrade
Install OpenCV
sudo apt install python3-opencv
Test installation
python3 -c 'import cv2; print(cv2.__version__)'
I can confirm, that openCV can be installed using sudo apt install python3-opencv. If it does not work, check if your board is connected to the internet (see coral documentation here).
you can install it with
$ sudo apt-get install python3-opencv

Installing opencv-python on raspberry pi 3, Raspbian Stretch

As above, trying to install opencv-python.
Normally this would be a simple pip install opencv-python, but it doesn't seem to work. Instead, opencv install to the miniconda directory
/home/pi/miniconda3/lib/python3.5/site-packages
instead of global
/usr/lib/python3.7
Trying to add opencv-python in Thorny through the application fails. In the python program...
import sys
sys.path.append('/home/pi/miniconda3/lib/python3.5/site-packages')
import cv2
results in a
No module named 'cv2.cv2'
I've tried adding it to path also (export PYTHONPATH=/home/pi/miniconda3/lib/python3.5/site-packages:$PYTHONPATH) with no luck.
Because pip is linked to your default Python and I think this default is your miniconda. A better approach is to call the Python version directly with pip. Additionally #Dave W. Smit mentioned that you should better install opencv-python-contrib to use the full OpenCV package (but donĀ“t use both packages!).
$ python-3.7 -m pip install opencv-python-contrib
Or you can use the pip version (if pip is at least version 0.8)
$ pip-3.7 install opencv-python-contrib
Or with pip version 1.5+
$ pip3.7 install opencv-python-contrib

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

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