简体   繁体   English

即使使用pip成功安装了名为“ cv2”的模块,也没有

[英]No module named 'cv2' even after successfully installing it using pip

I am working on ssd - tensor flow project. 我正在研究ssd-张量流项目。 For which I have to use cv2. 为此,我必须使用cv2。 I am able to import it in Jupyter notebook as well as in terminal too. 我也可以在Jupyter笔记本以及终端中导入它。

On running the following command 在运行以下命令

print cv2.__version__

I am getting output:- 我正在输出:-

3.4.1

which surely means its installed successfully. 这肯定意味着其安装成功。 (I used sudo pip install opencv-python command to install and had tried brew install as well to resolve the issue) , but still when I run my example.py files using terminal commands. (我使用sudo pip install opencv-python命令进行安装,并尝试了brew install来解决该问题),但是当我使用终端命令运行example.py文件时仍然如此。 they are giving the following error 他们给出了以下错误

No module named 'cv2

I had tried every possibility (by searching for every related issue but still not able to resolve it). 我已经尝试了所有可能性(通过搜索每个相关问题,但仍然无法解决它)。 Please help. 请帮忙。

这为我工作:

sudo apt-get install libopencv-dev python-opencv

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

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