ubuntu20.04安装opencv(系统默认Python3.8)
从预编译文件安装
#更新配置
sudo apt update
sudo apt upgrade
(base)tv@tv-desktop:~$ pip3 install opencv-python
Collecting opencv-python
Downloading opencv_python-4.5.2.52-cp38-cp38-manylinux2014_x86_64.whl (51.0 MB)
|████████████████████████████████| 51.0 MB 33 kB/s
Requirement already satisfied: numpy>=1.17.3 in /usr/lib/python3/dist-packages (from opencv-python) (1.17.4)
Installing collected packages: opencv-python
Successfully installed opencv-python-4.5.2.52
(base)tv@tv-desktop:~$ python3
Python 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2 as cv
>>> print(cv.__version__)
4.5.2
|