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

后端 未结 20 956
遥遥无期
遥遥无期 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:42

    Find where the cv2.so is, for example /usr/local/lib/python2.7/dist-packages, then add this into your ~/.bashrc by doing:

    sudo gedit ~/.bashrc
    

    and add

    export PYTHONPATH=/usr/local/lib/python2.7/dist-packages:$PYTHONPATH
    

    In the last line

    And then remember to open another terminal, this can be work, and I have solve my problem. Hope it can help you.

提交回复
热议问题