0

I am compiling OpenCV 3.4.1 in my Raspberry Pi 3b+. I have downloaded both opencv and opencv contrib. This is the build command I give : (ABSOLUTE NEWBIE in compiling using cmake and OpenCV)

cd ~/opencv-3.4.1/
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
      -D CMAKE_INSTALL_PREFIX=/usr/local \
      -D INSTALL_PYTHON_EXAMPLES=ON \
      -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.4.1/modules \
      -D ENABLE_PRECOMPILED_HEADERS=OFF \
      -D BUILD_EXAMPLES=ON ..

After the building process is over, the compilation process still uses python 2.7 interpreter. What other option should I add to compile it using python3. I looked on stackoverflow and found this :how to build opencv for python3 when both python2 and python3 are installed But since it does not have a correct answer I am a bit skeptical.

Followed this guide : https://www.deciphertechnic.com/install-opencv-python-on-raspberry-pi/

Using Python 3.5.3

Please ask for any further info that is required. Thanks.

5
  • "But since it does not have a correct answer I am a bit skeptical." - But you have tried its high voted answer, haven't you? Does it helps? Commented Feb 26, 2019 at 12:50
  • Ya I tried the highest voted answer. It didn't help. Python 2 was used to build opencv Commented Feb 26, 2019 at 12:51
  • 1
    It usually tells you after the cmake is done like a report and tells which version will be used. You can also use ccmake to change specific parameters a reconfigure it. look for the python params Commented Feb 26, 2019 at 12:59
  • I looked for the parameters that when I stumbled upon the mentioned question on stack overflow but the best voted answer didn't help. Commented Feb 26, 2019 at 13:05
  • 1
    Possible duplicate of I have 2 versions of python installed, but cmake is using older version. How do I force cmake to use the newer version? Commented Feb 26, 2019 at 13:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.