kwy
kwy

Reputation: 1

cannot import cv on OpenCV2.1

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 then import cv, it tells me ImportError: DLLload failed..

I have tried the solutions given in previous thread to copy the two files in the above path to C:\Python26\Lib\site-packages, but i still can't import cv.

Is it because I missed out doing some steps after installing? What could be the reasons to why the system cannot find the module cv?

Upvotes: 0

Views: 3544

Answers (1)

derpunktehund
derpunktehund

Reputation: 11

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.

Upvotes: 1

Related Questions