树莓派OpenCV_TensorFlow_PyTorch(Caffe2)安装

一、基本配置 

##确认是否打开了摄像头
vcgencmd get_camera
##给pip换源
 sudo mkdir ~/.pip
 cd .pip
 sudo vim pip.conf

[global]
timeout = 10
index-url =  http://mirrors.aliyun.com/pypi/simple/
extra-index-url= http://pypi.douban.com/simple/
[install]
trusted-host=
    mirrors.aliyun.com
    pypi.douban.com

二、安装

Python2直接装

sudo apt install libopencv-dev

sudo apt install python-opencv

##验证openCV
# pi @ raspberrypi in ~ [11:50:30]
$ python
Python 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'3.2.0'
>>>
>>> exit()

Python3编译安装

根目录扩充到整个内存卡(据说树莓派4b不用这步)

sudo raspi-config

7 Advanced Options

A1 Expand Filesystem

你可能感兴趣的:(树莓派,Linux)