📌 选择适合你的安装方式
🐍 Python 环境安装
- 使用
pip
安装:pip install opencv-python
- 或通过
conda
安装:conda install -c conda-forge opencv
🛠️ 从源码编译
- 克隆官方仓库:
git clone https://github.com/opencv/opencv.git
- 安装依赖并编译:
cd opencv mkdir build && cd build cmake .. make
📦 其他系统安装
- Ubuntu:
sudo apt-get install libopencv-dev
- Windows: 通过 OpenCV 官方安装包 下载预编译版本
📘 常见问题与解决方案
- 安装失败?检查是否已安装 Python_开发环境
- 依赖冲突?尝试使用虚拟环境隔离依赖