pip安装opencv安装命令
时间: 2024-01-19 08:16:38 浏览: 80
基于命令行pip安装opencv代码
以下是pip安装opencv的命令:
1. 只安装主模块:
```shell
pip install opencv-python
```
2. 安装全部模块(主模块+社区模块):
```shell
pip install opencv-contrib-python
```
3. 使用国内镜像下载:
清华源:
```shell
pip install opencv-contrib-python -i https://pypi.tuna.tsinghua.edu.cn/simple/
```
阿里源:
```shell
pip install opencv-contrib-python -i https://mirrors.aliyun.com/pypi/simple/
```
测试安装:
```python
import cv2
print(cv2.__version__)
```
阅读全文