使用或不使用Homebrew在Mac上安装OpenCV

问题描述 投票:1回答:1

我不能让brew安装OpenCV。

以下是brew给我的错误:

brew install opencv
Error: No available formula with the name "opencv" 
==> Searching for similarly named formulae...
Error: No similarly named formulae found. 
==> Searching taps...
Error: No formulae found in taps.

我之前安装了像hdf5和numpy这样的东西,因为brew对我不起作用。它总是说它找不到公式。我尝试过brew更新和酿造医生。

Brew医生给出了这个:

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
/Library/Frameworks/Python.framework/Versions/3.4/bin/python3-config
/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4-config
/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4m-config
/usr/local/CrossPack-AVR/bin/libusb-config

Warning: Your XQuartz (2.7.8_rc1) is outdated
Please install XQuartz 2.7.8:
https://xquartz.macosforge.org

Warning: Python is installed at /Library/Frameworks/Python.framework

Homebrew only supports building against the System-provided Python or a
brewed Python. In particular, Pythons installed to /Library can interfere
with other software installs.

我想我不喜欢自己安装Python。我相信在我知道brew存在之前很久就安装了它。几年前我就这么做了,从那以后我就一遍又一遍地更新了它。

因此,在自己编译和安装依赖项之后,我下载了OpenCV和Cmake,并在此处遵循Cmake设置指南http://blogs.wcode.org/2014/10/howto-install-build-and-use-opencv-macosx-10-10/

这是我尝试运行make后得到的错误:

Undefined symbols for architecture x86_64:
"_rpl_strerror", referenced from:
testing::internal::GetLastErrnoDescription() in    
libopencv_ts.a(ts_gtest.cpp.o)
testing::internal::DeathTestImpl::ReadAndInterpretStatusByte() in 
libopencv_ts.a(ts_gtest.cpp.o)
testing::internal::ExecDeathTest::AssumeRole() in 
libopencv_ts.a(ts_gtest.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see    
invocation)
make[2]: *** [bin/opencv_perf_core] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
make: *** [all] Error 2

最终目标是安装Caffe。我已经安装了CUDA。它现在只需要OpenCV。

在这一点上帮助我所有的Pythons并尝试酿造它们会有所帮助吗?我对酿造没有信心,因为它一直说它找不到东西。我可能更喜欢做自己的构建,当然这应该是可行的。无论Cmake失败了什么似乎都不应该与Python有关?

关于系统的更多信息:它运行10.11.9,绝对是x86_64架构,安装了Xcode和命令行工具,有两个Python版本加上Anaconda,并且肯定有一个NVIDIA CPU。总而言之,这是一款装有开发工具的Macbook Pro Retina。

macos opencv
1个回答
15
投票

OpenCV位于homebrew-science

你可以点击自制科学

brew tap homebrew/science

然后

brew install opencv

要么

brew install opencv3

或者没有点击:

brew install homebrew/science/opencv
brew install homebrew/science/opencv3
© www.soinside.com 2019 - 2024. All rights reserved.