Instead of cmake mentioned on the page, use this, cmake -D CMAKE_BUILD_TYPE=Release -D BUILD_NEW_PYTHON_SUPPORT=ON -D BUILD_opencv_python3=ON -D HAVE_opencv_python3=ON -D PYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3.4. You can find that out by using command whereis python3.4 (or, your version). Step 2 For installing opencv in specific version of python (ubuntu), you have to set the default (PYTHON_DEFAULT_EXECUTABLE) with the path to where your python is installed.
Brew install opencv for python 2 install#
I did sudo apt-get install python3-dev python3-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev That optional one too.!! And don't forget to change the python version for which you are installing. Note: Install all the 3 packages mentioned at start. Step 1 Follow all the steps as mentioned on openCv installation part till cmake. I will share the steps I followed so as to help others on it. I wanted opencv to be installed for python 3.4 but every time it was getting installed on 2.7 version. Installing opencv on python3.4 version has been quite a task. I am currently working with Google VM (ubuntu 14.04).
![brew install opencv for python 2 brew install opencv for python 2](https://informationfasr674.weebly.com/uploads/1/2/5/2/125274509/450364172.png)
The first part of the output is the expected location & the second part shows the current location of the config file. Copy the dev files: python3.5-config -includes The output should be similar to: -I/usr/include/python3.5m -I/usr/include/x86_64-linux-gnu/python3.5m.Install the developer packages for Python3.5: sudo apt-get install python3.5-dev.
Brew install opencv for python 2 update#
Update the repository: sudo apt-get updateĭownload the required packages to compile OpenCV: sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev.Here are the instructions I tested successfully and mentioned in the link above:
![brew install opencv for python 2 brew install opencv for python 2](https://robferguson.org/blog/content/images/2017/10/all-good.png)
![brew install opencv for python 2 brew install opencv for python 2](https://pyimagesearch.com/wp-content/uploads/2017/05/resolving_homebrew_error_header.jpg)
At the latest version it's fixed, try:īut I didn't download dev python and OpenCV, I took directly from github: I have OpenCV version 3.1 on Ubuntu 16.04 LTS to work with Python 3.5.1.