2012-09-06 127 views
7

我認爲sys路徑是正確的,cv.pyd和cv.pyd駐留在c:\ OpenCV2.3 \ build \ Python \ 2.7 \ Lib \ site-packages 。import cv2 works but import cv2.cv as cv not working

>>> import sys 
>>> sys.path 
['', 'C:\\Python27\\Lib\\idlelib', 'C:\\Python27\\lib\\site-packages\\pil-1.1.7-py2.7-win32.egg',  'C:\\Python27\\lib\\site-packages\\cython-0.17-py2.7-win32.egg', 'C:\\Python27\\lib\\site-packages\\pip-1.2-py2.7.egg', 'c:\\OpenCV2.3\\build\\Python\\2.7\\Lib\\site-packages', 'C:\\Python27\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages', 'C:\\Python27\\lib\\site-packages\\IPython\\extensions'] 

和進口品種或CV2似乎是確定但進口cv2.cv不

>>> import cv 
>>> import cv2.cv as cv 

Traceback (most recent call last): 
    File "<pyshell#4>", line 1, in <module> 
    import cv2.cv as cv 
ImportError: No module named cv 
>>> import cv2 
>>> cv.NamedWindow("camera", 1) 

...

可能是什麼導入錯誤的原因是什麼?

+6

對不起,我剛剛發現,在OpenCV2.3中,cv2模塊沒有cv屬性... – xdan

回答

相關問題