使用Homebrew安装openCV时遇到问题

问题描述 投票:1回答:1

我正在运行mac os x mavericks并且我正在尝试使用Homebrew安装openCV我不知道如何修复它我是否应该取消Homebrew和python并再试一次如果是这样我怎么能解除它们

首先,我做了这个红宝石-e“$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”然后这个酿造水龙头自制/科学,当我输入brew自制乡土/科学再次工作时我得到了警告:已经开始了!

但是当我输入brew info opencv时我得到了这个错误错误:opencv没有可用的公式,当我尝试brew install opencv时它显示了这个

Searching formulae...
Searching taps...
mymac:~ user$

这就是我跑啤酒医生时得到的

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: Python is installed at /Library/Frameworks/Python.framework

Homebrew only supports building against the System-provided Python or a
brewed Python. In particular, Pythons installed to /Library can interfere
with other software installs.

Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:

    2to3
    2to3-2.7
    idle
    idle2.7
    pydoc
    pydoc2.7
    python
    python-config
    python2.7
    python2.7-config
    pythonw
    pythonw2.7
    smtpd.py
    smtpd2.7.py

Consider setting your PATH so that /usr/local/bin
occurs before /usr/bin. Here is a one-liner:
    echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile

Warning: Your Xcode (6.0.1) is outdated
Please update to Xcode 6.1.
Xcode can be updated from the App Store.

UPDATE 1

我解决了我的问题,我决定发布它以防万一有人遇到同样的问题,这就是我所做的

untap homebrew/science
brew update
brew doctor 
brew tap homebrew/science
python opencv homebrew
1个回答
1
投票

这是我在linux上安装的程序。它在过去对我有用:

  1. http://opencv.org/downloads.html下载适用于Linux / Mac OS的OpenCV 2.4.9并解压缩。
  2. 在终端中,导航到新提取的目录,并在终端中使用build创建一个名为mkdir build的新目录。然后cdbuild
  3. 现在,在终端中输入:

cmake -D CMAKE_BUILD_TYPE = RELEASE -D CMAKE_INSTALL_PREFIX = / usr / local -D WITH_TBB = ON -D BUILD_NEW_PYTHON_SUPPORT = ON -D WITH_V4L = ON -D INSTALL_C_EXAMPLES = ON -D INSTALL_PYTHON_EXAMPLES = ON -D BUILD_EXAMPLES = ON -D WITH_QT = ON - D WITH_OPENGL = ON -D BUILD_JPEG = ON ..

  1. 完成后,输入终端make -j 4可能需要一段时间。
  2. 现在进入终端sudo make install
  3. 然后sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf' sudo ldconfig
  4. 如果它工作,你应该能够在python提示符下import cv2而不会出现任何错误。
© www.soinside.com 2019 - 2024. All rights reserved.