Anaconda安装dlib

直接在Anaconda Prompt(Anaconda)或者Anaconda Prompt(miniconda)中直接用pip安装时,会出现报错:

pip install dlib  -i https://pypi.douban.com/simple/

报错如下:

 Building wheels for collected packages: dlib
  Building wheel for dlib (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'D:\programfiles\miniconda\envs\py38torch_gpu\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\liqiang\\AppData\\Local\\Temp\\pip-install-8yr9wk5r\\dlib_39cae28f5613415ebde85cbacf2f1455\\setup.py'"'"'; __file__='"'"'C:\\Users\\liqiang\\AppData\\Local\\Temp\\pip-install-8yr9wk5r\\dlib_39cae28f5613415ebde85cbacf2f1455\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\liqiang\AppData\Local\Temp\pip-wheel-mtbx6cj2'
       cwd: C:\Users\liqiang\AppData\Local\Temp\pip-install-8yr9wk5r\dlib_39cae28f5613415ebde85cbacf2f1455\
  Complete output (8 lines):
  running bdist_wheel
  running build
  running build_py
  package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
  running build_ext

  ERROR: CMake must be installed to build dlib

  ----------------------------------------
  ERROR: Failed building wheel for dlib

  Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
    Running setup.py install for dlib ... error
    ERROR: Command errored out with exit status 1:
     command: 'D:\programfiles\miniconda\envs\py38torch_gpu\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\liqiang\\AppData\\Local\\Temp\\pip-install-8yr9wk5r\\dlib_39cae28f5613415ebde85cbacf2f1455\\setup.py'"'"'; __file__='"'"'C:\\Users\\liqiang\\AppData\\Local\\Temp\\pip-install-8yr9wk5r\\dlib_39cae28f5613415ebde85cbacf2f1455\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\liqiang\AppData\Local\Temp\pip-record-p940w927\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\programfiles\miniconda\envs\py38torch_gpu\Include\dlib'
         cwd: C:\Users\liqiang\AppData\Local\Temp\pip-install-8yr9wk5r\dlib_39cae28f5613415ebde85cbacf2f1455\
    Complete output (8 lines):
    running install
    running build
    running build_py
    package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
    running build_ext

    ERROR: CMake must be installed to build dlib

    ----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\programfiles\miniconda\envs\py38torch_gpu\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\liqiang\\AppData\\Local\\Temp\\pip-install-8yr9wk5r\\dlib_39cae28f5613415ebde85cbacf2f1455\\setup.py'"'"'; __file__='"'"'C:\\Users\\liqiang\\AppData\\Local\\Temp\\pip-install-8yr9wk5r\\dlib_39cae28f5613415ebde85cbacf2f1455\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\liqiang\AppData\Local\Temp\pip-record-p940w927\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\programfiles\miniconda\envs\py38torch_gpu\Include\dlib' Check the logs for full command output.

 安装方法:(直接下载whl文件——根据python的不同版本下载)

https://www.lfd.uci.edu/~gohlke/pythonlibs/https://www.lfd.uci.edu/~gohlke/pythonlibs/dlib · PyPIhttps://pypi.org/project/dlib/19.6.0/#files上面的网址可以寻找下载,有的python版本找不到,我直接放在下面的百度网盘里了

dlib-19.19.0-cp38-cp38-win_amd64.whl

dlib-19.17.99-cp37-cp37m-win_amd64.whl

dlib-19.7.0-cp36-cp36m-win_amd64.whl

有三个python版本的3.8,3.7,3.6的

链接:https://pan.baidu.com/s/1sRDPkDQqOXC28cJ-VI2YHA 
提取码:8888

 然后将下载后的文件放在你的Anaconda环境里

用dir找到你的文件,复制文件名,要放在对应的文件夹下面

然后使用下面的指令进行安装就OK了

 pip install dlib-19.19.0-cp38-cp38-win_amd64.whl.whl

 

  • 9
    点赞
  • 33
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

长沙有肥鱼

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值