简体   繁体   English

在 Raspberry pi 3 中安装 openCV 失败

[英]Install openCV in Raspberry pi 3 fails

when I try to install OpenCV in RAspberry Pi 3 B+, it gives me following error:当我尝试在 RAspberry Pi 3 B+ 中安装 OpenCV 时,出现以下错误:

$pip install opencv-python

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
ERROR: Could not find a version that satisfies the requirement opencv-python (from versions: 
none)
ERROR: No matching distribution found for opencv-python

I have tried other ways also:我也尝试过其他方法:

pip install opencv-contrib-python
pip3 install opencv-python
python3.6 -m pip install opencv-python

All give the same above error!都给出相同的上述错误!

I tried few other ways:我尝试了其他几种方法:

sudo apt install python3-opencv
sudo apt-get install libopencv-dev python-opencv

Still cant import cv2仍然无法导入 cv2

ModuleNotFoundError: No module named 'cv2'

I tried menpo channel我试过menpo频道

conda install -c menpo opencv
PackagesNotFoundError: The following packages are not available from current channels:

Please help.请帮忙。 What to do now?现在做什么?

OpenCv currently works on Raspbian 9-Stretch. OpenCv 目前适用于 Raspbian 9-Stretch。 Update os system:更新操作系统:

sudo apt-get update
sudo apt-get upgrade

2) Install dependencies: 2)安装依赖:

sudo apt-get install build-essential cmake pkg-config
sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev
sudo apt-get install libgtk2.0-dev libgtk-3-dev
sudo apt-get install libatlas-base-dev gfortran

3) Install Python 3 and Pip3: 3) 安装 Python 3 和 Pip3:

sudo apt-get install python3-dev
sudo apt-get install python3-pip

4) Install Opencv: 4)安装Opencv:

pip3 install opencv-python

5) Extra depencies for Opencv and the Camera: 5) Opencv 和相机的额外依赖:

sudo apt-get install libqtgui4
sudo modprobe bcm2835-v4l2
sudo apt-get install libqt4-test

Voila!瞧! OpenCv2 is installed.安装了 OpenCv2。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM