简体   繁体   English

在MacOS上使用Python3绑定安装OpenCV3时目录不为空

[英]Directory not empty in installing OpenCV3 with Python3 bindings on macOS

I've been trying to upgrade my OpenCV2 to OpenCV3 on my macOS Sierra 10.12.5, using homebrew and also have its bindings for both Python2 and Python3. 我一直在尝试使用自制软件在macOS Sierra 10.12.5上将OpenCV2升级到OpenCV3,并且还具有针对Python2和Python3的绑定。

Following the excellent guide at pyimagesearch, I got to run 遵循pyimagesearch的出色指南,我开始运行

brew install opencv3 --with-contrib --with-python3 --HEAD

(I first uninstalled OpenCV, just for clarity and to avoid any potential conflicts). (为了清楚起见并避免任何潜在的冲突,我首先卸载了OpenCV)。 Now, the guide explains that --with-contrib is downloading additional stuff, which is good to have; 现在,指南说明--with-contrib正在下载其他内容,这很不错; --with-python3 is downloading the bindings for Python3 (those for Python2 are automatically there); --with-python3正在下载Python3的绑定(用于Python2的绑定会自动存在); --HEAD is pulling the Github branch version rather than the tagged release, which is a workaround to a problem related to the QKIT Apple library. --HEAD正在拉出Github分支版本,而不是带标签的版本,这是解决与QKIT Apple库有关的问题的解决方法。

My problem is I get a 我的问题是我得到了

Error: Directory not empty - (/usr/local/Cellar/numpy/1.13.1, /usr/local/Cellar/numpy/1.13.1.tmp)

A brew doctor tells me Numpy is not linked but I'm not exactly sure what'd be the best way to proceed here. 一位brew doctor告诉我,Numpy没有链接,但是我不确定这是进行此操作的最佳方法。 Wouldn't want to break something. 不想破坏某些东西。

At this point, I just tested installing just the bindings for Python2, as in 在这一点上,我刚刚测试了仅安装Python2的绑定,如

brew install opencv3 --with-contrib --HEAD

and this leads me to this other problem: 这导致我遇到另一个问题:

Error: No such file or directory - /private/tmp/opencv3-20170714-55298-snr5jb/3rdparty/ippicv/downloader.cmake , Error: No such file or directory - /private/tmp/opencv3-20170714-55298-snr5jb/3rdparty/ippicv/downloader.cmake

which is solved with if I instead run 如果我改为跑步则可以解决

brew install opencv3 --with-contrib

This last one works, I got OpenCV3 for Python2. 这最后一个有效,我得到了适用于Python2的OpenCV3。 Apparently I don't have the HEAD issue. 显然我没有HEAD问题。

Now though, I still want the bindings for Python3 as well and due to the Numpy error above I'm not sure how to proceed? 现在,尽管如此,我仍然想要Python3的绑定,并且由于上述Numpy错误,我不确定如何继续? It seems like it's trying to install Numpy as a dependency, which I have already. 似乎它正在尝试将Numpy安装为依赖项,而我已经有了。

brew install opencv3 --with-contrib --with-python3 --HEAD

Instead of : 代替 :

brew install opencv3 --with-contrib --with-python3 --without-numpy

and See this : 并看到这个:

http://www.pyimagesearch.com/2017/05/15/resolving-macos-opencv-homebrew-install-errors/ http://www.pyimagesearch.com/2017/05/15/resolving-macos-opencv-homebrew-install-errors/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM