1.查看python版本
$ python3 --version
Python 3.6.5
2.
$ python3
>> print("OpenCV + Ubuntu 18.04!")
OpenCV + Ubuntu 18.04!
>> quit()
3.
$ sudo apt-get update
$ sudo apt-get upgrade
4.
$ sudo apt-get install build-essential cmake unzip pkg-config(重点)
$ sudo apt-get install libjpeg-dev libpng-dev libtiff-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 libgtk-3-dev
$ sudo apt-get install libatlas-base-dev gfortran
$ sudo a