无法在 anaconda 中安装 dlib

Posted

技术标签:

【中文标题】无法在 anaconda 中安装 dlib【英文标题】:Unable to install dlib in anaconda 【发布时间】:2019-03-07 06:19:56 【问题描述】:

我正在尝试在 Anaconda 中安装 dlib 以便在 jupyter-notebook 中使用它。

我尝试使用conda install -c menpo dlib,然后没有安装 dlib,而是说:

Downloading and Extracting Packages
py-boost-1.67.0      | 318 KB    | ################################################################# | 100% 
widgetsnbextension-1 | 1.1 MB    |                                                                   |   0% 
ipywidgets-5.1.5     | 61 KB     |                                                                   |   0% 
boost-1.59.0         | 11.9 MB   |                                                                   |   0% 
dlib-19.9            | 2.3 MB    |                                                                   |   0% 

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/menpo/osx-64/widgetsnbextension-1.2.3-py35_1.tar.bz2>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/menpo/osx-64/ipywidgets-5.1.5-py35_0.tar.bz2>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/menpo/osx-64/boost-1.59.0-py35_0.tar.bz2>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/menpo/osx-64/dlib-19.9-py35_0.tar.bz2>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

然后,我从here 下载了dlib-19.16.0.tar.gz 并将其保存在/anaconda3/lib/python3.6/site-packages 中,然后运行conda install -c conda-forge dlib-19.16.0.tar.gz 但它显示:

PackagesNotFoundError: The following packages are not available from current channels:

  - dlib-19.16.0.tar.gz

Current channels:

  - https://conda.anaconda.org/conda-forge/osx-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.anaconda.com/pkgs/main/osx-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/free/osx-64
  - https://repo.anaconda.com/pkgs/free/noarch
  - https://repo.anaconda.com/pkgs/r/osx-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/pro/osx-64
  - https://repo.anaconda.com/pkgs/pro/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

【问题讨论】:

【参考方案1】:

第一个错误只是说您无法连接到 menpo 库存储库。我建议检查您的代理/互联网连接。

在第二种情况下,您尝试安装 tar.gz 文件,这是一个压缩文件。先解压(解压)再安装。

【讨论】:

conda install -c conda-forge dlib-19.16.0 在解压 tar 文件后说同样的话。 下载***,.whl 文件,然后尝试以这种方式安装它。确保您的 Python 版本和操作系统是正确的,因为该***适用于 Python 3.6 和 Windows 64 位。顺便说一句,tar 文件仍然是一个压缩文件。因此,如果您解压缩它,您将能够看到 setup.py 文件和 dlib 库的所有其他组件。使用 setup.py 您将能够安装该库,但为了做到这一点,您需要一个 cpp 编译器等,所以我建议您使用该链接中提供的***安装它。

以上是关于无法在 anaconda 中安装 dlib的主要内容,如果未能解决你的问题,请参考以下文章

无法在 anaconda 中安装 prettytable

无法在 Windows 10 版本中安装 keras 或 tensorflow - Anaconda

在 Anaconda 中安装 Kivy

在 anaconda 中安装 dlib 的错误

在 Anaconda Python 中安装 Dlib

window在Anaconda中安装TensorFlow