在Mac OSX 10.10上为python安装Dlib时出现问题 [英] Trouble installing Dlib for python on Mac OSX 10.10

查看:186
本文介绍了在Mac OSX 10.10上为python安装Dlib时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在计算机上运行python的dlib-18.16(运行Mac OSX 10.10)。我已经安装了Boost python和X11,但是在下载文件后按照指示运行./compile_dlib_python_module.bat时遇到了麻烦。

I'm trying to install dlib-18.16 for python on my computer (running Mac OSX 10.10). I have boost python installed as well as X11, but I've been running into trouble when running ./compile_dlib_python_module.bat as instructed to after downloading the files.

错误我有很多,但是看起来像这样

The errors I get are numerous, but look something like this

[  1%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/fonts.o
In file included from /Users/xxx/Downloads/dlib-18.16/dlib/gui_widgets/fonts.cpp:14:
/Users/xxx/Downloads/dlib-18.16/dlib/gui_widgets/nativefont.h:313:21: error: use
      of undeclared identifier 'XAllocColor'
                    XAllocColor(d, cmap, &xcol);

这会持续一段时间并以

/Users/xxx/Downloads/dlib-18.16/dlib/gui_widgets/nativefont.h:400:21: error: use
      of undeclared identifier 'XFillRectangle'
                    XFillRectangle(d, pix, gc, 0, 0, width, height);
                    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [dlib_build/CMakeFiles/dlib.dir/gui_widgets/fonts.o] Error 1
make[1]: *** [dlib_build/CMakeFiles/dlib.dir/all] Error 2
make: *** [all] Error 2

我有检查了一些缺少的功能,例如XFillRectangle,并在python的anaconda安装中的某些.h文件中声明了它们(当查看dlib_build文件时,安装程​​序似乎已找到anaconda安装)。是否有人对如何解决此问题有任何想法?

I've checked for some of the missing functions like XFillRectangle, and found them declared in some .h files in the anaconda install of python (when looking at the dlib_build files, the installer seems to have located the anaconda install). Does anyone have any ideas as to how to fix this?

推荐答案

我意识到我必须进入CMakeCache.txt文件并手动将X11路径从anaconda更改为usr / X11 ,因为X11 .h文件的anaconda版本缺少这些XQuartz功能。现在一切正常。

I realized that I had to go into the CMakeCache.txt file and manually change the X11 path from anaconda to usr/X11, as the anaconda versions of the X11 .h files were missing some of these XQuartz functions. Everything works now.

这篇关于在Mac OSX 10.10上为python安装Dlib时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆