mac中使用brew install opencv出現錯誤

首先查看brew update升級信息git

brew update --verbose --forcegithub

fatal: Needed a single revisionurl

以前修改過源,致使出現416,git更新失敗.code

重置全部源homebrew

重置brew.git:
cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git

重置homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://github.com/Homebrew/homebrew-core.git

 

brew update --verbose --force rem

繼續執行it

Updating /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask...
fatal: Needed a single revision

須要進入到 /usr/local/Homebrew/Library/Taps/caskroom/homebrew-caskio

git pull 
From https://github.com/Caskroom/homebrew-cask
 * branch                  HEAD       -> FETCH_HEAD

從新執行 brew update 恢復正常.opencv

繼續brew search opencv2date

正常找出2個庫.

brew  install opencv@2

相關文章
相關標籤/搜索