The version of python installed on Ubuntu (16.04.3) was python2. I installed python3. I now install the opencv library on python3, the result is:
import cv2 Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named 'cv2'
But, it is OK in python2.
import cv2