OpenCV 4.0 Alpha Installation

asked 2018-10-28 05:20:25 -0500

jbtr142 gravatar image

updated 2018-10-28 05:46:36 -0500

berak gravatar image

I am attempting to install OpenCV 4 alpha using the following tutorial: https://www.pyimagesearch.com/2018/08...

The primary issue is when compiling with cmake running the command:

 cmake -D CMAKE_BUILD_TYPE=RELEASE \
 -D CMAKE_INSTALL_PREFIX=/usr/local \
 -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
 -D PYTHON3_LIBRARY=`python -c 'import subprocess ; import sys ; s = subprocess.check_output("python-config --configdir", shell=True).decode("utf-8").strip() ; (M, m) = sys.version_info[:2] ; print("{}/libpython{}.{}.dylib".format(s, M, m))'` \
 -D PYTHON3_INCLUDE_DIR=`python -c 'import distutils.sysconfig as s; print(s.get_python_inc())'` \
 -D PYTHON3_EXECUTABLE=$VIRTUAL_ENV/bin/python \
  -D BUILD_opencv_python2=OFF \
  -D BUILD_opencv_python3=ON \
 -D INSTALL_PYTHON_EXAMPLES=ON \
  -D INSTALL_C_EXAMPLES=OFF \
  -D BUILD_EXAMPLES=ON ..

Which outputs the following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'python-config --configdir' returned non-zero exit status 1
CMake Error at /usr/local/Cellar/cmake/3.12.3/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:47 (message):
  Could not find compiler set in environment variable CXX:

  /usr/local/bin/g++.

Call Stack (most recent call first):
  CMakeLists.txt:127 (project)


CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

Has anyone come up with this issue? I have attempted setting the CXX binary in the bash profile with no luck.

edit retag flag offensive close merge delete

Comments

what happens, if you try to execute python-config --configdir on a cmdline ? (seems, that part of it failed)

berak gravatar imageberak ( 2018-10-28 05:53:05 -0500 )edit