Why cv2.so missing after opencv installed?
How to install opencv(cv2) with python bindings in Linux - Ubuntu/Fedora
Install gcc, g++/gcc-c++, cmake (apt-get or yum, in case of yum use gcc-c++)
apt-get install gcc, g++, cmake
Downlaod latest opencv from openCV's website
Untar it with
tar -xvf opencv-*
Inside the untarred folder make a new folder called
mkdir release cd release
(or any folder name) and run this command in it
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_NEW_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON ..
..will pull files from the parents folder and will get the system ready for installation on your platform.
in the release folder run
After about 2-3 mins of make processing when its finished run
sudo make install
Export python path
That's it, now go to python and try
>>> import cv2
you should not get any error message.
Tested on python 2.7, should be virtually similar to python 3.x.
python-opencv to solve my problem in Ubuntu 14.04
sudo apt-get install python-opencv
Using raspbian on a rasberry pi I had the problem of the module not being found also. I had three versions of python (2.6, 2.7, and 3.2), be sure you are using python2.7. You can check this by running:
I found that for my case it was simply that I needed to install python-dev.
sudo apt-get install python-dev
I did Not have to remove and reinstall opencv, I tried my hardest to avoid that, knowing that it takes a few hours to complete the process.
After installing python-dev I went to the file I built the opencv into, for me it was " ~/opencv-2.4.9/release", and told it to make
after this I was able to find the cv2.so file. searching for it with:
find / -name "cv2.so"
at this point I found a few files. next I ran just the python to see if it could find "import" them
python >>> import cv2
no errors should come up.
>>> import numpy
I have heard that numpy was necessary for opencv to run. From there I believe you should be good to run your script, if no errors come about. I hope this helps.
The page that helped me is listed...