ubuntu18.04安装opencv-python
时间: 2023-04-25 22:03:53 浏览: 177
Ubuntu18.04安装opencv 3.2.0的解决方法
要在Ubuntu 18.04上安装opencv-python,您可以按照以下步骤进行操作:
1. 打开终端并更新软件包列表:
sudo apt-get update
2. 安装OpenCV的依赖项:
sudo apt-get install python3-dev python3-pip python3-numpy libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgtk-3-dev libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libatlas-base-dev gfortran
3. 安装opencv-python:
pip3 install opencv-python
4. 验证安装是否成功:
python3 -c "import cv2; print(cv2.__version__)"
如果成功安装,您应该能够看到OpenCV的版本号。
希望这可以帮助您安装opencv-python。
阅读全文