当我在python交互式shell中导入cv2时:
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> print cv2.__version__
2.4.8
>>>
但是当我运行这段代码时:
import cv2
print (cv2.__version__)
有错误说:
Traceback (most recent call last):
File "/home/ubuntu/workspace/test.py", line 1, in <module>
import cv2 as cv
ImportError: No module named 'cv2'
为什么会这样?