Forums

Inport cv2.aruco module for python2.7

I'm trying to import cv2.aruco: import cv2.aruco as aruco

I've already downloaded packages opencv-python and opencv-contrib-python (using commands "pip2.7 install --user opencv-python" and "pip2.7 install --user opencv-contrib-python"). They are under directory /home/eileen98/.local/lib/python2.7/site-packages:

cv2/    
opencv_contrib_python-3.4.1.15.dist-info/   
opencv_python-3.4.1.15.dist-info/

However, when I trying to import cv2.aruco, I still got the error: <type 'exceptions.ImportError'> Cannot import module 'applications.OpenCVTest.modules.cv2'

It seems to be the path problem right? how can I fix it? how to move these three folders to applications.OpenCVTest.modules?

I'm not sure about that. I suspect that your installed opencv is conflicting with the already installed one. Try installing it into a virtualenv and, if that doesn't work, maybe try some older versions.