0
votes

I have recently installed opencv 2.4.8 on my raspberry pi.When i check the version with

pkg-config --modversion opencv
2.4.8

But in my python code when i import cv2 i am getting the error as no module named cv2.I have checked my usr/local/lib/python2.7/site-packages and it is empty. How to solve the issue?

1

1 Answers

0
votes

Find cv2.so file (probably found at " ~/opencv-2.4.9/release"), or search it using

find / -name "cv2.so"

Copy this to usr/local/lib/python2.7/site-packages and you should be able to import cv2. If not, append the below two lines to your code:

import sys

sys.path.append('/usr/local/lib/python2.7/site-packages')