Installing OpenCV for Python on Ubuntu, getting ImportError: No module named cv2.cv

后端 未结 20 942
遥遥无期
遥遥无期 2020-11-28 23:48

I have an Ubuntu 14.04 system, on which I want to install OpenCV and use it with Python 2.x.

I installed OpenCV using the instructions here: https://help.ubuntu.com/

20条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-29 00:54

    Create a symbolic link to OpenCV. Eg:

    cd ~/.virtualenvs/cv/lib/python2.7/site-packages/
    ln -s /usr/local/lib/python2.7/dist-packages/cv2.so cv2.so
    ln -s /usr/local/lib/python2.7/dist-packages/cv.py cv.py
    

提交回复
热议问题