简体   繁体   中英

ImportError: No module named cv2 in caffe installed in ubuntu16.04

I installed caffe from this site on Ubuntu 16.04, python 2.7 is default and there is python 3.5.2 on system,too. I installed apollocaffe,too. When I was trying to run my code, an error occured:

ImportError: No module named cv2

I did execute this code : sudo apt-get install -y libopencv-dev as in installation guide is said.

and in Makefile.config I uncommented the line about "python3". I viewed the "dist-packages" in python3.5 and it is empty. what should I do??? I appreciate any help.

I found a workaround for my case:

pip install opencv-python

and now

import cv2

works.

Did you installed opencv2? then did you import it as cv2?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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