如何使用pip安装opencv? [英] How do I install opencv using pip?
问题描述
我需要为已为我编写的脚本安装cv2
.我尝试了pip install cv2
和pip install open_cv
并遇到了相同的问题-来自dist.py
的警告消息,并抱怨找不到zlib
.未安装cv2.我还尝试了pyopenvc
和pip install opencv-python
.
I need to install cv2
for a script that has been written for me. I tried pip install cv2
and pip install open_cv
and got the same problem - a warning message from dist.py
and complains about zlib
being not found. No cv2 installed. I also tried pyopenvc
and pip install opencv-python
.
因此,我去了opencv网站并下载了相关的exe.运行它-生成了一堆子目录以及一个make文件和其他东西.
So, I went to the opencv site and downloaded the relevant exe. Ran it - generated a heap of subdirectories and a make file and stuff.
我现在该怎么办?
推荐答案
安装 opencv-python
(这是用于Python的非官方预先构建的OpenCV软件包),方法是发出以下命令:
Install opencv-python
(which is an unofficial pre-built OpenCV package for Python) by issuing the following command:
pip install opencv-python
确保命令提示符具有sudo提升的权限.
Make sure your command prompt has sudo elevated permissions.
这篇关于如何使用pip安装opencv?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!