cannot import cv on OpenCV2.1

后端 未结 1 629
时光取名叫无心
时光取名叫无心 2021-01-28 23:38

I have downloaded OpenCV2.1 and Python2.6.

when i try to import cv using sys.path.append(\"C:\\OpenCV2.1\\Python2.6\\Lib\\site-packages\") and

1条回答
  •  粉色の甜心
    2021-01-28 23:52

    The OpenCV DLLs seem not to be found. Did you add OpenCV's bin directory to your PATH, "C:\OpenCV2.1\bin" in your case?


    To use the Python wrappers

    sys.path.append("C:\OpenCV2.1\Python2.6\Lib\site-packages")
    import cv
    

    should work, as well as copying cv.lib and cv.pyd to your C:\Python26\Lib\site-packages (assuming you installed Python to C:\Python26).

    But those wrappers have to find the DLLs they should wrap. So make sure, they are in a path Python can find them.

    Maybe this question Installing OpenCV on Windows 7 for Python 2.7 may help, especially Gia Thuy's journal post he mentions in his answer. Although he uses Python 2.7 and OpenCV 2.2, the procedure remains the same.

    0 讨论(0)
提交回复
热议问题