私はMac 10.9.5を使用しており、ここからpython用のdlibをインストールしようとしています
http://dlib.net/files/dlib-18.16.tar.bz2
私のpythonのインストールはずっと前に行われましたconda:
Current conda install:
platform : osx-64
conda version : 3.16.0
conda-build version : 1.3.5
python version : 2.7.10.final.0
requests version : 2.7.0
root environment : //anaconda (writable)
default environment : //anaconda
envs directories : //anaconda/envs
package cache : //anaconda/pkgs
channel URLs : https://repo.continuum.io/pkgs/free/osx-64/
https://repo.continuum.io/pkgs/free/noarch/
https://repo.continuum.io/pkgs/pro/osx-64/
https://repo.continuum.io/pkgs/pro/noarch/
config file : None
is foreign system : False
dlib をインストールするには、次のルーチンに従いました。
$ tar xvjf dlib-18.16.tar.bz2
$ cd dlib-18.16/python_examples/
$ mkdir build
$ cd build
$ cmake ../../tools/python
$ cmake --build . --config Release --target install
compile_dlib_python_module.bat次のファイルで指定されているとおり/Users/javier/dlib-18.16/python_examples
Xlocale.h最初にとに関連するエラーが発生しましXosdefs.hた。
これらのファイルは、/opt/local/include/X11およびにあり/opt/X11/include/X11ます。/anaconda/include/X11これら 2 つに関連するエラー メッセージが表示されないため、問題を解決したと思われるファイルをコピーしました。
走る:
$ cmake --build . --config Release --target install
そして今、私は次のような多くのエラーメッセージを受け取ります:
[ 1%] Building CXX object dlib_build/CMakeFiles/dlib.dir/gui_widgets/fonts.o
/Users/javier/dlib-18.16/dlib/gui_widgets/nativefont.h:313:21: error: use of undeclared identifier 'XAllocColor'
XAllocColor(d, cmap, &xcol);
/Users/javier/dlib-18.16/dlib/gui_widgets/nativefont.h:319:36: error: use of undeclared identifier 'XmbTextExtents'; did you mean 'XTextExtents'?
return XmbTextExtents(fs, str, len, ink, logical);
^~~~~~~~~~~~~~
XTextExtents
/Users/javier/dlib-18.16/dlib/gui_widgets/nativefont.h:318:43: note: 'XTextExtents' declared here
inline static int XTextExtents (XFontSet fs, char *str, int len, XRectangle *ink, XRectangle *logical){
関連ファイルはすべてXmbTextExtentsに/opt/X11/share/man/man3 あり、圧縮されたバージョン ( XmbTextExtents.3.gz) はここにあります/opt/local/share/man/man3。
エラーは、dlib のインストールが見る/anaconda/include/X11/べきときに見ているという事実から発生します/opt/X11/include/X11(私は推測します)。CMakeCache.txtファイル内の関連する KEYS を次のように編集しようとしました。
x11_path:FILEPATH=/opt/X11/include
//Path to a file.
xlib_path:PATH=/opt/X11/include/X11
しかし、うまくいきません。Homebrew で「フレッシュ」に開始するようにアドバイスされました (つまり、conda と macports から痕跡をすべて削除し、Homebrew でインストール全体をやり直します)。すでにたくさんのものをインストールしています。
念のため、私の .profile ファイルの関連行は次のようになります。
setenv PATH /opt/local/bin:/opt/local/sbin:$PATH
# anaconda path takes priority
setenv PATH /anaconda/bin:$PATH
お時間をいただきありがとうございます。