Closed beeftornado closed 10 years ago
I have a similar problem, difference is that I installed OpenCV before installing python and right now they are both working. But for some reason I get some errors when I issue $ brew info opencv
.
I get the same errors as @beeftornado, when attempting to install opencv.
I am reporting similar issue: https://gist.github.com/reidel/8576150
Admittedly my XQuartz requires updating and some /../man/ directories require fixing permissions, but it shouldn't affect the installation as per the error message.
FYI I wan't getting any errors with opencv until after I installed brewed python.
Saw this https://github.com/Homebrew/homebrew-science/issues/628#issuecomment-33263610 as possible solution.
Probably caused by https://github.com/Homebrew/homebrew/pull/24842
After a brew update
it appears to be working now.
Bah, spoke too soon.
==> Upgrading opencv
==> Downloading https://github.com/Itseez/opencv/archive/2.4.7.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/opencv-2.4.7.1.tar.gz
==> Patching
patching file cmake/OpenCVFindOpenNI.cmake
==> cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/opencv/2.4.7.1 -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -DCMAK
==> make
^
2 errors generated.
make[2]: *** [modules/python/CMakeFiles/opencv_python.dir/src2/cv2.cpp.o] Error 1
make[1]: *** [modules/python/CMakeFiles/opencv_python.dir/all] Error 2
make: *** [all] Error 2
In file included from /tmp/opencv-flGN/opencv-2.4.7.1/modules/python/src2/cv2.cpp:10:
In file included from /Library/Python/2.7/site-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from /Library/Python/2.7/site-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/include/numpy/ndarraytypes.h:1736:
/Library/Python/2.7/site-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/include/numpy/npy_deprecated_api.h:23:2: error: Should never include npy_deprecated_api directly.
#error Should never include npy_deprecated_api directly.
^
In file included from /tmp/opencv-flGN/opencv-2.4.7.1/modules/python/src2/cv2.cpp:10:
In file included from /Library/Python/2.7/site-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from /Library/Python/2.7/site-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/include/numpy/ndarraytypes.h:1736:
In file included from /Library/Python/2.7/site-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/include/numpy/npy_deprecated_api.h:126:
/Library/Python/2.7/site-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/include/numpy/old_defines.h:6:2: error: The header "old_defines.h" is deprecated as of NumPy 1.7.
#error The header "old_defines.h" is deprecated as of NumPy 1.7.
^
2 errors generated.
make[2]: *** [modules/python/CMakeFiles/opencv_python.dir/src2/cv2.cpp.o] Error 1
make[1]: *** [modules/python/CMakeFiles/opencv_python.dir/all] Error 2
make: *** [all] Error 2
==> Formula
Tap: homebrew/science
Path: /usr/local/Library/Taps/homebrew-science/opencv.rb
==> Configuration
HOMEBREW_VERSION: 0.9.5
HEAD: 25a31179a984972984a5074c21ced0ab1674e561
CPU: 8-core 64-bit ivybridge
OS X: 10.9.1-x86_64
Xcode: 5.0.2
CLT: 5.0.1.0.1.1382131676
X11: 2.7.5 => /opt/X11
==> ENV
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j8
CMAKE_PREFIX_PATH: /usr/local
CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_PATH: /usr/local/opt/libpng/lib/pkgconfig
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/10.9
HOMEBREW_VERBOSE: 1
ACLOCAL_PATH: /usr/local/share/aclocal
PATH: /usr/local/Library/ENV/4.3:/usr/local/opt/cmake/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libpng/bin:/usr/bin:/bin:/usr/sbin:/sbin
Error: opencv did not build
I did a brew update && brew upgrade yesterday and tried it out now: https://gist.github.com/reidel/8617608
It seems to have been fixed? However, no mention of fix on this thread.
Closing this if it seems fixed. Will reopen if anyone reports its still broken.
Please see my previous comment. The original error is fixed, but it's now failing to build for a new reason.
[100%] [100%] Generating pyopencv_generated_funcs.h, pyopencv_generated_func_tab.h, pyopencv_generated_types.h, pyopencv_generated_type_reg.h, pyopencv_generated_const_reg.h
Generating generated0.i
cd /tmp/opencv-elFL/opencv-2.4.7.1/macbuild/modules/python && /usr/bin/python /tmp/opencv-elFL/opencv-2.4.7.1/modules/python/src2/gen2.py /tmp/opencv-elFL/opencv-2.4.7.1/macbuild/modules/python /tmp/opencv-elFL/opencv-2.4.7.1/modules/core/include/opencv2/core/core.hpp /tmp/opencv-elFL/opencv-2.4.7.1/modules/flann/include/opencv2/flann/miniflann.hpp /tmp/opencv-elFL/opencv-2.4.7.1/modules/imgproc/include/opencv2/imgproc/imgproc.hpp /tmp/opencv-elFL/opencv-2.4.7.1/modules/video/include/opencv2/video/background_segm.hpp /tmp/opencv-elFL/opencv-2.4.7.1/modules/video/include/opencv2/video/tracking.hpp /tmp/opencv-elFL/opencv-2.4.7.1/modules/photo/include/opencv2/photo/photo.hpp /tmp/opencv-elFL/opencv-2.4.7.1/modules/highgui/include/opencv2/highgui/highgui.hpp /tmp/opencv-elFL/opencv-2.4.7.1/modules/ml/include/opencv2/ml/ml.hpp /tmp/opencv-elFL/opencv-2.4.7.1/modules/features2d/include/opencv2/features2d/features2d.hpp /tmp/opencv-elFL/opencv-2.4.7.1/modules/calib3d/include/opencv2/calib3d/calib3d.hpp /tmp/opencv-elFL/opencv-2.4.7.1/modules/objdetect/include/opencv2/objdetect/objdetect.hpp /tmp/opencv-elFL/opencv-2.4.7.1/modules/contrib/include/opencv2/contrib/contrib.hpp /tmp/opencv-elFL/opencv-2.4.7.1/modules/nonfree/include/opencv2/nonfree/features2d.hpp /tmp/opencv-elFL/opencv-2.4.7.1/modules/nonfree/include/opencv2/nonfree/nonfree.hpp
cd /tmp/opencv-elFL/opencv-2.4.7.1/macbuild/modules/python && /usr/bin/python /tmp/opencv-elFL/opencv-2.4.7.1/modules/python/src2/gen.py /tmp/opencv-elFL/opencv-2.4.7.1/modules/python/src2
Generated 377 functions
Note: Class Feature2D has more than 1 base class (not supported by Python C extensions)
Bases: cv::FeatureDetector, cv::DescriptorExtractor
Only the first base class will be used
cd /tmp/opencv-elFL/opencv-2.4.7.1/macbuild && /usr/local/Cellar/cmake/2.8.12.1/bin/cmake -E cmake_depends "Unix Makefiles" /tmp/opencv-elFL/opencv-2.4.7.1 /tmp/opencv-elFL/opencv-2.4.7.1/modules/python /tmp/opencv-elFL/opencv-2.4.7.1/macbuild /tmp/opencv-elFL/opencv-2.4.7.1/macbuild/modules/python /tmp/opencv-elFL/opencv-2.4.7.1/macbuild/modules/python/CMakeFiles/opencv_python.dir/DependInfo.cmake --color=
Scanning dependencies of target opencv_python
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f modules/python/CMakeFiles/opencv_python.dir/build.make modules/python/CMakeFiles/opencv_python.dir/build
/usr/local/Cellar/cmake/2.8.12.1/bin/cmake -E cmake_progress_report /tmp/opencv-elFL/opencv-2.4.7.1/macbuild/CMakeFiles
[100%] Building CXX object modules/python/CMakeFiles/opencv_python.dir/src2/cv2.cpp.o
cd /tmp/opencv-elFL/opencv-2.4.7.1/macbuild/modules/python && /usr/local/Library/ENV/4.3/clang++ -DPYTHON_USE_NUMPY=1 -Dopencv_python_EXPORTS -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -mavx -Wno-unused-function -fPIC -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/python/src2 -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/contrib/include -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/nonfree/include -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/ocl/include -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/gpu/include -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/photo/include -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/objdetect/include -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/legacy/include -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/video/include -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/ml/include -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/calib3d/include -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/features2d/include -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/highgui/include -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/imgproc/include -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/flann/include -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/core/include -I/tmp/opencv-elFL/opencv-2.4.7.1/macbuild/modules/python -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/python/src -I/tmp/opencv-elFL/opencv-2.4.7.1/modules/python/include -I/tmp/opencv-elFL/opencv-2.4.7.1/macbuild -isystem /System/Library/Frameworks/Python.framework/Headers -isystem /Library/Python/2.7/site-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/include -o CMakeFiles/opencv_python.dir/src2/cv2.cpp.o -c /tmp/opencv-elFL/opencv-2.4.7.1/modules/python/src2/cv2.cpp
In file included from /tmp/opencv-elFL/opencv-2.4.7.1/modules/python/src2/cv2.cpp:10:
In file included from /Library/Python/2.7/site-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from /Library/Python/2.7/site-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/include/numpy/ndarraytypes.h:1736:
/Library/Python/2.7/site-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/include/numpy/npy_deprecated_api.h:23:2: error: Should never include npy_deprecated_api directly.
#error Should never include npy_deprecated_api directly.
^
In file included from /tmp/opencv-elFL/opencv-2.4.7.1/modules/python/src2/cv2.cpp:10:
In file included from /Library/Python/2.7/site-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from /Library/Python/2.7/site-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/include/numpy/ndarraytypes.h:1736:
In file included from /Library/Python/2.7/site-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/include/numpy/npy_deprecated_api.h:126:
/Library/Python/2.7/site-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/include/numpy/old_defines.h:6:2: error: The header "old_defines.h" is deprecated as of NumPy 1.7.
#error The header "old_defines.h" is deprecated as of NumPy 1.7.
^
2 errors generated.
make[2]: *** [modules/python/CMakeFiles/opencv_python.dir/src2/cv2.cpp.o] Error 1
make[1]: *** [modules/python/CMakeFiles/opencv_python.dir/all] Error 2
make: *** [all] Error 2
==> Formula
Tap: homebrew/science
Path: /usr/local/Library/Taps/homebrew-science/opencv.rb
==> Configuration
HOMEBREW_VERSION: 0.9.5
HEAD: 9f6de2e60949236c99184650ff03a6d1d4943bbe
CPU: 8-core 64-bit ivybridge
OS X: 10.9.1-x86_64
Xcode: 5.0.2
CLT: 5.0.1.0.1.1382131676
X11: 2.7.5 => /opt/X11
==> ENV
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j8
CMAKE_PREFIX_PATH: /usr/local
CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_PATH: /usr/local/opt/libpng/lib/pkgconfig
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/10.9
HOMEBREW_VERBOSE: 1
ACLOCAL_PATH: /usr/local/share/aclocal
PATH: /usr/local/Library/ENV/4.3:/usr/local/opt/cmake/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libpng/bin:/usr/bin:/bin:/usr/sbin:/sbin
Error: opencv did not build
Got it to work! I installed the homebrew python and then latest numpy. I had been using system python and numpy.
brew install python
pip install numpy --upgrade
FWIW, I was having a similar problem with opencv installation on Maverics. Problem persisted after brew doctor and brew update. Problem disappeared when I (temporarily) pip-uninstalled numpy.
@mikemcquaid this error is not solved it seems
I got a similar problem:
==> Installing opencv dependency: cmake ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/cmake-3.0.0.mavericks. ######################################################################## 100.0% ==> Pouring cmake-3.0.0.mavericks.bottle.tar.gz 🍺 /usr/local/Cellar/cmake/3.0.0: 1622 files, 25M ==> Installing opencv ==> Downloading https://github.com/Itseez/opencv/archive/2.4.9.tar.gz Already downloaded: /Library/Caches/Homebrew/opencv-2.4.9.tar.gz ==> cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/opencv/2.4.9 -DCMAKE_BUILD_TYPE=None ==> make ^ 1 error generated. make[2]: * [modules/python/CMakeFiles/opencv_python.dir/src2/cv2.cpp.o] Error 1 make[1]: * [modules/python/CMakeFiles/opencv_python.dir/all] Error 2 make: *\ [all] Error 2
I got the same problem as @minhtuev. Is there any proceeding?
I have the same problem, it is because I installed Canopy from Macport? What should I do? Many thanks
Please take a look at https://github.com/Homebrew/homebrew/wiki/Troubleshooting and open a new ticket with a brew gist-logs
link after following that advice.
https://gist.github.com/beeftornado/8554950