问题
When I give the following command
brew install homebrew/science/opencv
or
brew install opencv
I get the following message.
Warning: opencv-2.4.7.1 already installed, it's just not linked
Any idea how to fix this.
I already have the following in the .bash_profile
based on the links.
Installing openCV 2.4.2 on Mac OS X 10.9 (Mavericks)
export PYTHONPATH=/usr/local/Cellar/opencv/2.4.6.1/lib/python2.7/site-packages:$PYTHONPATH
Linking Python with Open CV on Mac
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
When I do a link using the following command, I get the following error.
$brew link opencv
Linking /usr/local/Cellar/opencv/2.4.7.1... Warning: Could not link opencv. Unlinking...
Error: Could not symlink file: /usr/local/Cellar/opencv/2.4.7.1/lib/pkgconfig/opencv.pc
/usr/local/lib/pkgconfig is not writable. You should change its permissions.
Any ideas how to fix this ?
Thanks.
回答1:
I solved the problem with brew link --overwrite --dry-run opencv
回答2:
I've got the same problem. And by following the post mentioned above, I solve the problem through a series of chown
command suggested by brew doctor
.
Here is what I got when I use brew doctor
Warning: Some directories in /usr/local/share/man aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.
You should probably `chown` them:
/usr/local/share/man/de
/usr/local/share/man/de/man1
/usr/local/share/man/mann
So I change the own of these folders.
After that I use brew link --overwrite opencv
Now when I type brew link opencv, it shows
Warning: Already linked: /usr/local/Cellar/opencv/2.4.11
To relink: brew unlink opencv && brew link opencv
I think it works.
回答3:
I solve this problem by use
sudo chown -R $USER /usr/local/lib/python2.7/site-packages
then
brew link numpy
回答4:
I run 'brew doctor' and then just followed the brew doctor instructions
来源:https://stackoverflow.com/questions/21140953/opencv-installed-but-not-linked-error-message-on-os-x-mavericks