一开始用brew install opencv3 --with-python3 --c++11 --with-contrib
报错如下
Error: Calling 'depends_on :python' is disabled!
Use 'depends_on "python@2"' instead.
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/opencv.rb:32:in `<class:Opencv>'
Please report this to the homebrew/core tap!
Or, even better, submit a PR to fix it!
后来用这个就可以了brew install opencv3 --with-contrib--with-python3 --without-python
顺利安装到最后报错
==> Pouring python-3.6.5.high_sierra.bottle.tar.gz
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied @ dir_s_mkdir - /usr/local/Frameworks
Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks
一是权限问题,而是无法创建文件夹
那就手动创建一个sudo mkdir /usr/local/Frameworks
输入密码就行
权限问题的话用sudo chown -R (whoami)(brew –prefix)/*
似乎不行,改成sudo chown -R $(whoami):admin $(brew --prefix)/*
就行了
最后brew link python3
就解决了
测试还是不行