简体   繁体   English

在anaconda中安装dlib的错误

[英]Error of Installing dlib in anaconda

I'm trying to install Dlib in anaconda python with this line:我正在尝试使用以下行在 anaconda python 中安装 Dlib:

conda install -c menpo dlib

and I'm getting error like this:我收到这样的错误:

UnsatisfiableError: The following specifications were found to be in conflict:
  - dlib
  - xlwt
Use "conda info <package>" to see the dependencies for each package.

How can I solve this problem?我该如何解决这个问题?

Path of core-meta: C/users/{xxx}/anaconda3/core-meta core-meta 路径: C/users/{xxx}/anaconda3/core-meta

Delete core-meta then run the following commands:删除 core-meta 然后运行以下命令:

  1. Conda update --all
  2. Conda install dlib

These commands require an internet connection so keep wifi on during the command running process.这些命令需要互联网连接,因此在命令运行过程中保持 wifi 开启。

Here xxx is the username on your computer.这里xxx是您计算机上的用户名。

如果您的项目不需要 xlwt-package,只需创建一个新的 conda 环境并在该环境中本地安装 dlip 包。

you can also try following:您也可以尝试以下操作:

brew install cmake
brew install boost

then create a virtual environment using conda command然后使用 conda 命令创建一个虚拟环境

conda create -n dlib python=3.6 anaconda

Activate the environment激活环境

source activate dlib

run the following command运行以下命令

conda install pip

and finally install dlib using below command最后使用以下命令安装 dlib

pip install dlib

This worked for me.这对我有用。

For anaconda or miniconda3, please see the following installation procedures.对于 anaconda 或 miniconda3,请参阅以下安装步骤。 It will comply with Python 3.7 in this way.它将以这种方式符合 Python 3.7。

1.Install cmake with git 1.用git安装cmake

$ sudo apt-get install git cmake

2. Enter into the the directory 2.进入目录

Please change user to your own username请将用户更改为您自己的用户名

$ cd /home/user/dlib

3. Compile dlib 3.编译dlib

$ python setup.py install

If meeting with the issue that you could not put the import statements of setuptools behind the import statement of distutils, please change the placement oder in setup.py in the directory of dlib.如果遇到无法将setuptools的import语句放在distutils的import语句后面的问题,请更改dlib目录下setup.py中的放置顺序。

from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext

from distutils import log
from distutils.version import LooseVersion

4. Run the dlib unit test suite in the current working directory 4.在当前工作目录下运行dlib单元测试套件

Please note there is a sub-directory of dlib inlcuded in the directory of dlib.请注意,dlib 目录下有一个dlib 子目录。

$ cd dlib/test
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build . --config Release
$./dtest --runall

Cheers.干杯。

on mac system : you have to do it via brew在 mac 系统上:你必须通过 brew 来完成

  1. brew install cmake酿造安装cmake
  2. brew install boost酿造安装升压
  3. brew install boost-python --with-python3 brew install boost-python --with-python3

After installing above packages if you need you can create your environment and proceed with dlib installation or you can simply run next step.如果需要,安装上述软件包后,您可以创建环境并继续安装 dlib,或者您可以简单地运行下一步。

The dlib library doesn't have any real Python prerequisites, but if you plan on using dlib for any type of computer vision or image processing, These are few libraries which you can install for dlib : dlib 库没有任何真正的 Python 先决条件,但如果您计划将 dlib 用于任何类型的计算机视觉或图像处理,您可以为 dlib 安装以下几个库:

* NumPy
* SciPy
* scikit-image
  1. pip install numpy pip 安装 numpy

5 pip install Scipy 5 pip 安装 Scipy

  1. pip install scikit-image pip 安装 scikit-image

  2. pip install dlib pip安装dlib

you can check for more details on this link: https://www.pyimagesearch.com/2017/03/27/how-to-install-dlib/您可以在此链接上查看更多详细信息: https : //www.pyimagesearch.com/2017/03/27/how-to-install-dlib/

你必须尝试只放:

conda install dlib

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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