Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用自制软件安装openCV时遇到问题_Python_Opencv_Homebrew - Fatal编程技术网

Python 使用自制软件安装openCV时遇到问题

Python 使用自制软件安装openCV时遇到问题,python,opencv,homebrew,Python,Opencv,Homebrew,我正在运行mac os x mavericks,我正在尝试使用自制软件安装openCV我不知道如何修复它我应该unistall Homebrew和python,然后再试一次如果是的话,我如何unistall它们 首先我做了这个 ruby-e“$(curl-fsSL)” 那么这个 brew点击自制/科学 这是有效的,因为当我再次键入brew点击自制/科学时,我得到了警告:已点击 但是当我键入brew info opencv时,出现了这个错误 错误:opencv没有可用的公式 当我尝试brew安装o

我正在运行mac os x mavericks,我正在尝试使用自制软件安装openCV我不知道如何修复它我应该unistall Homebrew和python,然后再试一次如果是的话,我如何unistall它们

首先我做了这个 ruby-e“$(curl-fsSL)” 那么这个 brew点击自制/科学 这是有效的,因为当我再次键入brew点击自制/科学时,我得到了警告:已点击

但是当我键入brew info opencv时,出现了这个错误 错误:opencv没有可用的公式 当我尝试brew安装opencv时,它显示了这一点

Searching formulae...
Searching taps...
mymac:~ user$
这就是我运行brew doctor时得到的结果

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.
更新1 我解决了我的问题,我决定发布它,以防有人遇到同样的问题 这就是我所做的

untap homebrew/science
brew update
brew doctor 
brew tap homebrew/science

这是我在linux上安装的过程。在过去,它对我非常有效:

  • 从for Linux/Mac OS下载OpenCV 2.4.9并解压缩

  • 在终端中,导航到新提取的目录,并在终端中使用
    mkdir build
    创建名为
    build
    的新目录。然后
    cd
    build

  • 现在,在终端中,输入:

  • cmake-D cmake\u BUILD\u TYPE=RELEASE-D cmake\u INSTALL\u PREFIX=/usr/local -D带有\u TBB=ON-D构建\u新建\u PYTHON\u支持=ON-D带有\u V4L=ON-D安装\u C\u示例=ON-D安装\u PYTHON\u示例=ON-D BUILD\u EXAMPLES=ON-D WITH\u QT=ON-D WITH\u OPENGL=ON-D BUILD\u JPEG=ON

  • 完成后,在终端
    make-j4
    中输入可能需要一段时间

  • 现在进入终端
    sudomakeinstall

  • 然后
    sudosh-c'echo”/usr/local/lib“>/etc/ld.so.conf.d/opencv.conf'sudoldconfig

  • 如果它起作用,您应该能够在python提示符下导入cv2,而不会出现任何错误


  • 尝试从源代码构建它。@Ryan如何从源代码构建