简体   繁体   English

为什么 ImportError: No module named 'cv2' 错误仅适用于 python3?

[英]Why ImportError: No module named 'cv2' error come only for python3?

for python2, open cv library successfully added.对于python2,打开cv库成功添加。 But while i choose python3 i can't.但是当我选择 python3 时我不能。 Default version is python3.5.默认版本是python3.5。 Here i have attached the screenshot.在这里我附上了截图。

ImportError: No module named 'cv2'导入错误:没有名为“cv2”的模块

在此处输入图像描述

This seems to be installation problem.这似乎是安装问题。 The python interpreter should the path of all libraries that are available for use. python 解释器应该是所有可用库的路径。 By default, the directory containing the python interpreter should be containing all the libraries that are compatible with that version.默认情况下,包含 python 解释器的目录应该包含与该版本兼容的所有库。 You should try this command which python3 to know the python3 installation path and see if the cv2 library installed there or not.你应该尝试这个命令which python3来了解 python3 安装路径,看看 cv2 库是否安装在那里。 You need to refer the how python interpreter finds the third part libraries.您需要参考 python 解释器如何找到第三方库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM