我正在尝试通过brew安装opencv,
但向我展示了以下错误。
我知道我应该点击“brew tap homebrew / homebrew-science”
但它不起作用。
有什么想法,或者我应该通过什么命令显示哪些信息来快速解决问题。
感谢〜
[local] $ brew update
Error: Permission denied - /var/folders/wt/ffjhmkgx4292wtm22b966mdc0000gn/T/.gitignore20130904-819-fdlv65-0 or /usr/local/Library/Formula/.gitignore
[local] $ sudo brew update
Already up-to-date.
[local] $ sudo brew install opencv
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
Error: No available formula for opencv
[local] $ brew tap homebrew/homebrew-science
Error: Already tapped!
[local] $ sudo brew tap homebrew/homebrew-science
Error: Already tapped!
[local] $ sudo brew install opencv
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
Error: No available formula for opencv
[local] $ brew install opencv
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
Error: No available formula for opencv
如果我尝试通过教程http://tilomitra.com/opencv-on-mac-osx/手动制作 我会在make -j8
之后看到错误 _ff_xvid_rate_control_uninit in libavcodec.a(libxvid_rc.o)
"_xvid_plugin_lumimasking", referenced from:
_xvid_encode_init in libavcodec.a(libxvid.o)
"_xvid_plugin_single", referenced from:
_xvid_encode_init in libavcodec.a(libxvid.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]: *** [lib/libopencv_highgui.2.4.6.dylib] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2
答案 0 :(得分:2)
我最近遇到了使用brew构建OpenCV的类似问题。核心问题是OpenCV在构建ffmpeg时无法正常构建(如果还安装了ffmpeg,它会尝试这样做。)
正如建议的here,可以通过使用以下brew命令来构建OpenCV来解决问题,OpenCV强制构建环境的替代版本(brew的顶级troubleshooting suggestions之一):< / p>
brew install opencv --env=std
希望这也适合你!