简体   繁体   中英

anaconda dlib and X11

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 .

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:

  1. Clean up dlib installed via conda:
    conda uninstall dlib
  2. Install cmake and boost-bython with homebrew:
    brew install cmake
    brew install boost-python
  3. Build dlib from source:
    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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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