Hi I have a raspberry pi 2 model B with raspbain installed on it, I want to do machine vision applications so I installed openCV 3.0.0 version with Python 3+ following this tutorial: http://www.pyimagesearch.com/2015/07/27/installing-opencv-3-0-for-both-python-2-7-and-python-3-on-your-raspberry-pi-2/#comment-364261
I wanted to compile my first program (which I took from here https://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_gui/py_image_display/py_image_display.html#display-image):
import numpy as np
import cv2
img = cv2.imread('messi5.jpg',0)
cv2.imshow('image',img)
k = cv2.waitKey(0)
if k == 27:
cv2.destroyAllWindows()
and I get this error:
ImportError: No module named cv2.cv
so searching for help I found this: OpenCV - cannot find module cv2 and added:
import sys
sys.path.append('/usr/local/lib/python2.7/site-packages')
to my code (changing python2.7 for python3.2 because that's the one I have) and now the error I get is this:
ImportError: /home/pi/cv2.so: undefined symbol: _PyUnicode_AsString
I also verified that openCV is correctly installed typing the following command in the terminal:
$ workon cv
$ python
>>> import cv2
>>> cv2.__version__
'3.0.0'
So that's all I did, I'm new to Linux, RPi, Python and openCV. I deeply aprreciate your help, thanks a lot