ubuntu18.04安装pythonopencv
时间: 2023-10-09 12:16:41 浏览: 113
Ubuntu下安装opencv-python(详解)
5星 · 资源好评率100%
你可以按照以下步骤在Ubuntu 18.04上安装Python OpenCV:
1. 打开终端并更新软件包列表:
```
sudo apt update
```
2. 安装OpenCV依赖项:
```
sudo apt install python3-dev python3-pip python3-tk libjpeg-dev libtiff-dev libpng-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libatlas-base-dev gfortran libopencv-dev python-opencv
```
3. 安装完成后,检查OpenCV版本:
```
pkg-config --modversion opencv4
```
4. 启动Python 3解释器:
```
python3
```
5. 在Python中导入OpenCV并检查版本:
```
import cv2
cv2.__version__
```
这样就可以在Ubuntu 18.04上安装Python OpenCV了。
阅读全文