H992109898 2016-08-31 08:42 采纳率: 33.3%
浏览 27462
已采纳

python安装dlib模块出错

使用python -m pip install dlib
出错原因如下:
python -m pip install dlib
Collecting dlib
Using cached dlib-19.1.0.tar.gz
Building wheels for collected packages: dlib
Running setup.py bdist_wheel for dlib ... error
Complete output from command D:\python语言\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\users\administrator\appdata\local\temp\pip-build-yjbauy\dlib\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), file, 'exec'))" bdist_wheel -d c:\users\administrator\appdata\local\temp\tmpebunu3pip-wheel- --python-tag cp27:
running bdist_wheel
running build
error: Cannot find cmake, ensure it is installed and in the path.
You can install cmake using the instructions at https://cmake.org/install/
You can also specify its path with --cmake parameter.


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

Complete output from command D:\python语言\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\users\administrator\appdata\local\temp\pip-build-yjbauy\dlib\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), file, 'exec'))" install --record c:\users\administrator\appdata\local\temp\pip-xtjkek-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
error: Cannot find cmake, ensure it is installed and in the path.
You can install cmake using the instructions at https://cmake.org/install/
You can also specify its path with --cmake parameter.

----------------------------------------

Command "D:\python语言\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\users\administrator\appdata\local\temp\pip-build-yjbauy\dlib\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), file, 'exec'))" install --record c:\users\administrator\appdata\local\temp\pip-xtjkek-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\administrator\appdata\loc
以前安装过python2和python3,现在已经把python3卸载了。
使用pip install XXX会出现错误,所以才用python -m pip install dlib
windows 64为位的系统

  • 写回答

3条回答

  • Valtava 2016-08-31 15:37
    关注

    windows下安装dlib需要CMake, 需要一个C++编译器(g++, VS 都可以), 需要boost库,并且需要在环境变量path中添加这些东西.
    然后就可以直接用pip安装 (或者进入到源码 py -2 setup.py install)了

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)