龙空技术网

Mac 安装dlib

小D大调 441

前言:

如今咱们对“matlab安装出现cannot find”可能比较关注,朋友们都想要学习一些“matlab安装出现cannot find”的相关内容。那么小编也在网络上网罗了一些关于“matlab安装出现cannot find””的相关文章,希望你们能喜欢,看官们一起来了解一下吧!

安装dlib

官方文档,可查看[How to install dlib from source on macOS or Ubuntu]()

安装失败:需要先安装openblas和opencv

dlib的依赖

- 第一步:dlib安装需要的依赖有openblas,opencv。可以直接使用brew安装。

$ brew install openblas$ brew install opencv

安装出现:gcc安装失败(具体显示如问题),需安装gcc:)

- 第二步:Mac的X11

X11是执行Unix程序的图形窗口环境。Mac OS X本身的程序是Aqua界面的,但是为了能够兼容unix和linux移植过来的程序(Mac OS X由BSD-UNIX修改而来),比如MatLab,就需要x11窗口环境。

运行dlib需要X11,但Mac目前没有自带X11,需要重新下载安装,[下载地址](),下载后直接安装,默认安装目录为/opt/X11,需要在/usr/loca/opt目录下创建软连接,创建命令如下,创建后重启Mac。

$ cd /usr/local/opt$ ln -s /opt/X11 X11
遇到的问题:

`brew install openblas`安装时显示如下:

Warning: Your Xcode (10.0) is outdated.Please update to Xcode 10.1 (or delete it).Xcode can be updated from the App Store.Warning: Building gcc from source: The bottle needs the Xcode CLT to be installed.xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrunError: An exception occurred within a child process: CompilerSelectionError: gcc cannot be built with any available compilers.Install GNU's GCC brew install gcc

解决办法:安装或更新到最新版本的Xcode

重新安装Xcode后,重新安装gcc,显示:

 Warning: Building gcc from source: The bottle needs the Xcode CLT to be installed.xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrunError: An exception occurred within a child process: CompilerSelectionError: gcc cannot be built with any available compilers.Install GNU's GCC brew install gcc

解决办法:需要安装Xcode CLT

参考地址

- Mac下的dlib安装: 作者:SnailTyan

标签: #matlab安装出现cannot find