Reputation: 4885
I am on a mac os X Yosemite. I installed dlib with anaconda with:
conda install -c menpo dlib=19.4
and then removed X11
from anaconda/lib
since the X11
distributed by anaconda
is presumably broken. Then I installed Xquartz from https://www.xquartz.org/.
But when I go into ipython
and import dlib
, and type
dlib.image_window()
I am still getting error:
AttributeError: 'module' object has no attribute 'image_window'
What's the issue?
Note I tried installing dlib
from scratch when anaconda
is not in my system, and I ran into all kinds of other issues. So currently I am committed to making dlib work with anaconda, which it does, except for image_window
and presumably other things associated with X11
.
Upvotes: 2
Views: 3724
Reputation: 3278
I ran into the same issue on my Mac. After doing readings on GitHub, I don't think there exists a workaround for installing dlib with anaconda, since something is not right with X11 headers used by anaconda.
I am able to make dlib.image_window()
work after building dlib from source using the latest version available on the repo. The steps are large the same as suggested here on GitHub. The following steps were carried out in a conda environment I use exclusively for computer vision applications:
conda uninstall dlib
brew install cmake
brew install boost-python
git clone https://github.com/davisking/dlib.git
cd dlib/
mkdir build
cd build/
cmake .. -DDLIB_USE_CUDA=0 -DUSE_AVX_INSTRUCTIONS=1; cmake --build .
python setup.py install --yes USE_AVX_INSTRUCTIONS --no DLIB_USE_CUDA
The codes took a while to build, but the library works for me in the end.
Upvotes: 3