【问题标题】:OpenCV installed but not linked error message on OS-X MavericksOS-X Mavericks 上已安装 OpenCV 但未链接错误消息
【发布时间】:2014-02-04 03:07:48
【问题描述】:

当我给出以下命令时

brew install homebrew/science/opencv

brew install opencv 

我收到以下消息。

Warning: opencv-2.4.7.1 already installed, it's just not linked

知道如何解决这个问题。 根据链接,我已经在.bash_profile 中有以下内容。

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 

当我使用以下命令进行链接时,我收到以下错误。

$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.

任何想法如何解决这个问题?

谢谢。

【问题讨论】:

标签: python macos opencv homebrew osx-mavericks


【解决方案1】:

我通过使用解决了这个问题 sudo chown -R $USER /usr/local/lib/python2.7/site-packages

那么 brew link numpy

【讨论】:

    【解决方案2】:

    我用 brew link --overwrite --dry-run opencv 解决了这个问题

    【讨论】:

    • 我不明白,我认为空运行实际上并没有改变任何东西。我试过了,喜欢它显示了更改的内容,但错误仍然存​​在
    【解决方案3】:

    我也遇到了同样的问题。并且按照上面提到的帖子,我通过brew doctor建议的一系列chown命令解决了这个问题。 这是我使用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
    

    所以我更改了这些文件夹的所有权。

    之后我使用brew link --overwrite opencv

    现在当我输入 brew link opencv 时,它会显示

    Warning: Already linked: /usr/local/Cellar/opencv/2.4.11
    To relink: brew unlink opencv && brew link opencv
    

    我认为它有效。

    【讨论】:

      【解决方案4】:

      我运行“brew doctor”,然后按照 brew doctor 的说明进行操作

      【讨论】:

        猜你喜欢
        • 2013-11-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-01-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-05-08
        相关资源
        最近更新 更多