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/
Its complete installation nightmare, but I'll give one more hope you can avoid building opencv from source:
pip install opencv-contrib-python
For those who are trying to use 3.1.0 but after installing python says "cv2 module not found".
You likely have python but not python-dev.
sudo apt-get install python-dev
then reinstall 3.1.0 and it'll work.
if you are using pycharm platform it's very simple go into
view=>tool windows==>python console
after that you will see in the bottom the console with [1] :
type this !pip install opencv-python
I also had this issue. Tried different things. But finally
conda install opencv
worked for me.
I think you don't have the python-opencv
package.
I had the exact same problem and
sudo apt-get install python-opencv
solved the issue for me.
you can install opencv from the following link https://www.learnopencv.com/install-opencv3-on-ubuntu/ It works for me . apt-get install doesnt contain many packages of opencv
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.