【发布时间】:2021-08-23 05:36:36
【问题描述】:
尝试使用 pip3 install dlib 命令下载 dlib,但出现异常。如何解决以下问题?
Collecting dlib
Using cached dlib-19.22.0.tar.gz (7.4 MB)
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\PATH\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Shiladittya\\AppData\\Local\\Temp\\pip-install-40do86q8\\dlib_b343cff879474b048ae9f0f7abe0c9ae\\setup.py'"'"'; __file__='"'"'C:\\Users\\Shiladittya\\AppData\\Local\\Temp\\pip-install-40do86q8\\dlib_b343cff879474b048ae9f0f7abe0c9ae\\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\Shiladittya\AppData\Local\Temp\pip-wheel-2kmgy0vh'
cwd: C:\PATH\\Local\Temp\pip-install-40do86q8\dlib_b343cff879474b048ae9f0f7abe0c9ae\
Complete output (58 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
Building extension for Python 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\PATH\\Local\Temp\pip-install-40do86q8\dlib_b343cff879474b048ae9f0f7abe0c9ae\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Shiladittya\AppData\Local\Temp\pip-install-40do86q8\dlib_b343cff879474b048ae9f0f7abe0c9ae\build\lib.win-amd64-3.9 -DPYTHON_EXECUTABLE=C:\Users\Shiladittya\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Shiladittya\AppData\Local\Temp\pip-install-40do86q8\dlib_b343cff879474b048ae9f0f7abe0c9ae\build\lib.win-amd64-3.9 -A x64'
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:5 (message):
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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++.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "<string>", line 1, in <module>
【问题讨论】:
标签: python-3.x face-recognition