当我尝试在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
我也试过其他方法。
pip install opencv-contrib-python
pip3 install opencv-python
python3.6 -m pip install opencv-python
都出现了同样的错误!
我尝试了一些其他方法。
sudo apt install python3-opencv
sudo apt-get install libopencv-dev python-opencv
还是不能导入cv2
ModuleNotFoundError: No module named 'cv2'
我试过menpo频道
conda install -c menpo opencv
PackagesNotFoundError: The following packages are not available from current channels:
请大家帮忙。现在该怎么办?
OpenCv目前在Raspbian 9-Stretch上工作。更新操作系统。
sudo apt-get update
sudo apt-get upgrade
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) 安装Python 3和Pip3。
sudo apt-get install python3-dev
sudo apt-get install python3-pip
4) 安装Opencv。
pip3 install opencv-python
5) 为Opencv和Camera安装额外的依赖项。
sudo apt-get install libqtgui4
sudo modprobe bcm2835-v4l2
sudo apt-get install libqt4-test
瞧! OpenCv2 安装完毕。