使用 python 3.8 windows 10 错误安装 dlib
Installing dlib with python 3.8 windows 10 error
我无法使用 cmd 在 python 上安装 dlib,我已经下载了 cmake 并将其放在 PATH 上,或者是否有任何插件我必须先下载它?还是我的 pip 环境位于错误的位置?或者我是否必须将 python 更改为 64 位而不是 32 位?如果我必须这样做,请告诉我方法,我是新手
C:\Users\Yusuf>python -m pip install dlib --user
Collecting dlib
Using cached https://files.pythonhosted.org/packages/63/92/05c3b98636661cb80d190a5a777dd94effcc14c0f6893222e5ca81e74fbc/dlib-19.19.0.tar.gz
Installing collected packages: dlib
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files (x86)\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py'"'"'; __file__='"'"'C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Yusuf\AppData\Local\Temp\pip-record-0h0t6gan\install-record.txt' --single-version-externally-managed --compile --user --prefix=
cwd: C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\
Complete output (65 lines):
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)]
Invoking CMake setup: 'cmake C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\build\lib.win32-3.8 -DPYTHON_EXECUTABLE=C:\Program Files (x86)\Python38-32\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\build\lib.win32-3.8'
-- Building for: Visual Studio 16 2019
-- The C compiler identification is MSVC 19.24.28314.0
-- The CXX compiler identification is MSVC 19.24.28314.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: C:/Program Files (x86)/Python38-32/python.exe (found version "3.8")
CMake Error at C:/Users/Yusuf/AppData/Local/Temp/pip-install-lpo7_ajq/dlib/dlib/external/pybind11/tools/FindPythonLibsNew.cmake:124 (message):
Python config failure: Python is 32-bit, chosen compiler is 64-bit
Call Stack (most recent call first):
C:/Users/Yusuf/AppData/Local/Temp/pip-install-lpo7_ajq/dlib/dlib/external/pybind11/tools/pybind11Tools.cmake:16 (find_package)
C:/Users/Yusuf/AppData/Local/Temp/pip-install-lpo7_ajq/dlib/dlib/external/pybind11/CMakeLists.txt:33 (include)
-- Configuring incomplete, errors occurred!
See also "C:/Users/Yusuf/AppData/Local/Temp/pip-install-lpo7_ajq/dlib/build/temp.win32-3.8/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py", line 223, in <module>
setup(
File "C:\Program Files (x86)\Python38-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Program Files (x86)\Python38-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Program Files (x86)\Python38-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Program Files (x86)\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files (x86)\Python38-32\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Program Files (x86)\Python38-32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Program Files (x86)\Python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files (x86)\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files (x86)\Python38-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Program Files (x86)\Python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files (x86)\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Program Files (x86)\Python38-32\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\tools\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\build\lib.win32-3.8', '-DPYTHON_EXECUTABLE=C:\Program Files (x86)\Python38-32\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\build\lib.win32-3.8']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Program Files (x86)\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py'"'"'; __file__='"'"'C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Yusuf\AppData\Local\Temp\pip-record-0h0t6gan\install-record.txt' --single-version-externally-managed --compile --user --prefix= Check the logs for full command output.
请帮帮我谢谢!
注意:首先确保你已经安装了c++编译器和cmake 然后开始跟随sptes:
单击克隆或下载按钮,然后通过单击 zip 下载手动下载包下载完成后,解压缩文件并将其放在桌面
3.Then 打开 Powershell 或 cmd
4.type 命令中 cd C:/users/(your username)/Desktop/master-dlib/master-dlib
5.Then 更改当前工作目录后输入命令 python setup.py install
注意 2:这是手动方式,但也要查看 。
转到 python.org 复制 link 最新二进制可执行文件或特定于您的 python 版本的二进制文件的位置。
在cmd提示符下输入python -m pip install
+粘贴link位置。
现在 运行 你的 .py 文件有 dlib .
我无法使用 cmd 在 python 上安装 dlib,我已经下载了 cmake 并将其放在 PATH 上,或者是否有任何插件我必须先下载它?还是我的 pip 环境位于错误的位置?或者我是否必须将 python 更改为 64 位而不是 32 位?如果我必须这样做,请告诉我方法,我是新手
C:\Users\Yusuf>python -m pip install dlib --user
Collecting dlib
Using cached https://files.pythonhosted.org/packages/63/92/05c3b98636661cb80d190a5a777dd94effcc14c0f6893222e5ca81e74fbc/dlib-19.19.0.tar.gz
Installing collected packages: dlib
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files (x86)\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py'"'"'; __file__='"'"'C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Yusuf\AppData\Local\Temp\pip-record-0h0t6gan\install-record.txt' --single-version-externally-managed --compile --user --prefix=
cwd: C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\
Complete output (65 lines):
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)]
Invoking CMake setup: 'cmake C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\build\lib.win32-3.8 -DPYTHON_EXECUTABLE=C:\Program Files (x86)\Python38-32\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\build\lib.win32-3.8'
-- Building for: Visual Studio 16 2019
-- The C compiler identification is MSVC 19.24.28314.0
-- The CXX compiler identification is MSVC 19.24.28314.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: C:/Program Files (x86)/Python38-32/python.exe (found version "3.8")
CMake Error at C:/Users/Yusuf/AppData/Local/Temp/pip-install-lpo7_ajq/dlib/dlib/external/pybind11/tools/FindPythonLibsNew.cmake:124 (message):
Python config failure: Python is 32-bit, chosen compiler is 64-bit
Call Stack (most recent call first):
C:/Users/Yusuf/AppData/Local/Temp/pip-install-lpo7_ajq/dlib/dlib/external/pybind11/tools/pybind11Tools.cmake:16 (find_package)
C:/Users/Yusuf/AppData/Local/Temp/pip-install-lpo7_ajq/dlib/dlib/external/pybind11/CMakeLists.txt:33 (include)
-- Configuring incomplete, errors occurred!
See also "C:/Users/Yusuf/AppData/Local/Temp/pip-install-lpo7_ajq/dlib/build/temp.win32-3.8/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py", line 223, in <module>
setup(
File "C:\Program Files (x86)\Python38-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Program Files (x86)\Python38-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Program Files (x86)\Python38-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Program Files (x86)\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files (x86)\Python38-32\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Program Files (x86)\Python38-32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Program Files (x86)\Python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files (x86)\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files (x86)\Python38-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Program Files (x86)\Python38-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files (x86)\Python38-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Program Files (x86)\Python38-32\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\tools\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\build\lib.win32-3.8', '-DPYTHON_EXECUTABLE=C:\Program Files (x86)\Python38-32\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\build\lib.win32-3.8']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Program Files (x86)\Python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py'"'"'; __file__='"'"'C:\Users\Yusuf\AppData\Local\Temp\pip-install-lpo7_ajq\dlib\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Yusuf\AppData\Local\Temp\pip-record-0h0t6gan\install-record.txt' --single-version-externally-managed --compile --user --prefix= Check the logs for full command output.
请帮帮我谢谢!
注意:首先确保你已经安装了c++编译器和cmake 然后开始跟随sptes:
单击克隆或下载按钮,然后通过单击 zip 下载手动下载包下载完成后,解压缩文件并将其放在桌面
3.Then 打开 Powershell 或 cmd
4.type 命令中 cd C:/users/(your username)/Desktop/master-dlib/master-dlib
5.Then 更改当前工作目录后输入命令 python setup.py install
注意 2:这是手动方式,但也要查看
转到 python.org 复制 link 最新二进制可执行文件或特定于您的 python 版本的二进制文件的位置。
在cmd提示符下输入
python -m pip install
+粘贴link位置。现在 运行 你的 .py 文件有 dlib .