Python3.9安装dlib报错无数后记录
- 解决方案
- 报错显示
- vs2022的c++安装
- 安装boost和cmake
- 配置cmake环境变量
- 之前尝试过的方法
解决方案
注意python3.9就选择cp39的dlib包,否则报错:
ERROR: dlib-19.7.0-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.
https://blog.csdn.net/DoubleJ2/article/details/115399326
报错显示
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
You must use Visual Studio to build a python extension on windows. If you
are getting this error it means you have not installed Visual C++. Note
that there are many flavors of Visual Studio, like Visual Studio for C#
development. You need to install Visual Studio for C++.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
显示 我没有安装Vc++,但是我已经安装好了
vs2022的c++安装
官网下载免费社区版,并且进入D盘cl命令后,确认已经安装
命令行找到cd D:\vs2022\VC\Tools\MSVC\14.31.31103\bin\Hostx64\x64>输入cl
显示这个就是安装好了
安装boost和cmake
pip3 install boost
pip3 install cmake
经常报错在cmake但是我确实是安装ok了的 迷惑
确认一下:
只要在命令行输入cmake
这样应该也是安装好了的
配置cmake环境变量
在Path中加上D:\vs2022\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin
之前尝试过的方法
参考:https://blog.csdn.net/DoubleJ2/article/details/115399326
打开vs的x64的窗口
无事发生,依然报错,只是这次的报错换了一个子进程报错;
我这次是打算按照网上说的 下载dlib官网上的包然后找到setup
再用python setup.py install 也报错:
subprocess.CalledProcessError: Command ‘[‘cmake’, ‘D:\python3.9\dlib-19.23\tools\python’, ‘-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=D:\python3.9\dlib-19.23\build\lib.win-amd64-3.9’, ‘-DPYTHON_EXECUTABLE=D:\python3.9\python.exe’, ‘-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=D:\python3.9\dlib-19.23\build\lib.win-amd64-3.9’, ‘-A’, ‘x64’]’ returned non-zero exit status 1.
题主初学者 到现在还是没能知道问题出在哪里 还请评论帮忙看一下~但是直接运行编译好的cp39包就可以成功安装啦
确认一下:
参考:文章来源:https://uudwc.com/A/93Xm
- 记一次Win10环境python3.7安装dlib模块趟过的坑.
2: windows10下编译dllib报错: ERROR: Failed building wheel for dlib.文章来源地址https://uudwc.com/A/93Xm