Anaconda安装dlib

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

pip install dlib

# 或者

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 · PyPI
https://pypi.org/project/dlib/19.6.0/#files
 

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

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

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

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

 

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值