直接pip安装pip install albumentations
报错:
ERROR: Command errored out with exit status 1:
command: 'D:\anaconda3\envs\pytorch\python.exe' 'D:\anaconda3\envs\pytorch\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\verse\AppData\Local\Temp\tmpv1nq01li'
cwd: C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80
Complete output (193 lines):
--------------------------------------------------------------------------------
-- Trying 'Ninja (Visual Studio 17 2022 x64 v143)' generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Error at CMakeLists.txt:2 (PROJECT):
Generator
Ninja
does not support platform specification, but platform
x64
was specified.
-- Configuring incomplete, errors occurred!
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying 'Ninja (Visual Studio 17 2022 x64 v143)' generator - failure
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Trying 'Visual Studio 17 2022 x64 v143' generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22000.
-- The C compiler identification is MSVC 19.37.32824.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- The CXX compiler identification is MSVC 19.37.32824.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (3.7s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/verse/AppData/Local/Temp/pip-install-0r8a7kdz/opencv-python-headless_0424c6bf158f4491a240264e96a43d80/_cmake_test_compile/build
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying 'Visual Studio 17 2022 x64 v143' generator - success
--------------------------------------------------------------------------------
Configuring Project
Working directory:
C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build
Command:
'C:\Users\verse\AppData\Local\Temp\pip-build-env-idsrka90\overlay\Lib\site-packages\cmake\data\bin/cmake.exe' 'C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\opencv' -G 'Visual Studio 17 2022' '-DCMAKE_INSTALL_PREFIX:PATH=C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-install' -DPYTHON_VERSION_STRING:STRING=3.6.13 -DSKBUILD:INTERNAL=TRUE '-DCMAKE_MODULE_PATH:PATH=C:\Users\verse\AppData\Local\Temp\pip-build-env-idsrka90\overlay\Lib\site-packages\skbuild\resources\cmake' '-DPYTHON_EXECUTABLE:PATH=D:\anaconda3\envs\pytorch\python.exe' '-DPYTHON_INCLUDE_DIR:PATH=D:\anaconda3\envs\pytorch\Include' '-DPYTHON_LIBRARY:PATH=D:\anaconda3\envs\pytorch\libs\python36.lib' '-DPython_EXECUTABLE:PATH=D:\anaconda3\envs\pytorch\python.exe' '-DPython_ROOT_DIR:PATH=D:\anaconda3\envs\pytorch' '-DPython_INCLUDE_DIR:PATH=D:\anaconda3\envs\pytorch\Include' -DPython_FIND_REGISTRY:STRING=NEVER '-DPython_NumPy_INCLUDE_DIRS:PATH=C:\Users\verse\AppData\Local\Temp\pip-build-env-idsrka90\overlay\Lib\site-packages\numpy\core\include' '-DPython3_EXECUTABLE:PATH=D:\anaconda3\envs\pytorch\python.exe' '-DPython3_ROOT_DIR:PATH=D:\anaconda3\envs\pytorch' '-DPython3_INCLUDE_DIR:PATH=D:\anaconda3\envs\pytorch\Include' -DPython3_FIND_REGISTRY:STRING=NEVER '-DPython3_NumPy_INCLUDE_DIRS:PATH=C:\Users\verse\AppData\Local\Temp\pip-build-env-idsrka90\overlay\Lib\site-packages\numpy\core\include' -T v143 -A x64 '-DPYTHON3_EXECUTABLE=D:\anaconda3\envs\pytorch\python.exe' '-DPYTHON_DEFAULT_EXECUTABLE=D:\anaconda3\envs\pytorch\python.exe' -DPYTHON3_INCLUDE_DIR=D:/anaconda3/envs/pytorch/Include -DPYTHON3_LIBRARY=D:/anaconda3/envs/pytorch/libs/python36.lib -DBUILD_opencv_python3=ON -DBUILD_opencv_python2=OFF -DBUILD_opencv_java=OFF -DOPENCV_PYTHON3_INSTALL_PATH=python -DINSTALL_CREATE_DISTRIB=ON -DBUILD_opencv_apps=OFF -DBUILD_opencv_freetype=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_DOCS=OFF -DPYTHON3_LIMITED_API=ON -DBUILD_OPENEXR=ON -DCMAKE_GENERATOR_PLATFORM=x64 -DWITH_WIN32UI=OFF -DWITH_QT=OFF -DWITH_GTK=OFF -DCMAKE_BUILD_TYPE:STRING=Release
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22000.
-- The CXX compiler identification is MSVC 19.37.32824.0
-- The C compiler identification is MSVC 19.37.32824.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Users/verse/AppData/Local/Temp/pip-build-env-idsrka90/overlay/Lib/site-packages/cmake/data/share/cmake-3.28/Modules/CMakeTestCXXCompiler.cmake:60 (message):
The C++ compiler
"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: 'C:/Users/verse/AppData/Local/Temp/pip-install-0r8a7kdz/opencv-python-headless_0424c6bf158f4491a240264e96a43d80/_skbuild/win-amd64-3.6/cmake-build/CMakeFiles/CMakeScratch/TryCompile-enjbb7'
Run Build Command(s): "C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe" cmTC_73365.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=17.0 /v:n
閫傜敤浜\x8e .NET Framework MSBuild 鐗堟湰 17.7.2+d6990bcfa
鐢熸垚鍚\xaf鍔ㄦ椂闂翠负 2024/5/8 11:38:44銆\x82
鑺傜偣 1 涓婄殑椤圭洰鈥淐:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj鈥\x9d(榛樿\xaeょ洰鏍\x87)銆\x82
PrepareForBuild:
姝e湪鍒涘缓鐩\xae褰曗\x80渃mTC_73365.dir\Debug\鈥濄\x80\x82
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(541,5): warning MSB8029: 涓\xad闂寸洰褰曟垨杈撳嚭鐩\xae褰曟棤娉曢┗鐣欏湪涓存椂鐩\xae褰曚笅锛屽洜涓鸿繖鍙\xaf鑳戒細瀵艰嚧澧為噺鐢熸垚鍑 虹幇闂\xae棰樸\x80\x82 [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
姝e湪鍒涘缓鐩\xae褰曗\x80淐:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\Debug\鈥濄\x80\x82
姝e湪鍒涘缓鐩\xae褰曗\x80渃mTC_73365.dir\Debug\cmTC_73365.tlog\鈥濄\x80\x82
InitializeBuildStatus:
姝e湪鍒涘缓鈥渃mTC_73365.dir\Debug\cmTC_73365.tlog\unsuccessfulbuild鈥濓紝鍥犱负宸叉寚瀹氣\x80淎lwaysCreate鈥濄\x80\x82
姝e湪瀵光\x80渃mTC_73365.dir\Debug\cmTC_73365.tlog\unsuccessfulbuild鈥濇墽琛\x8c Touch 浠诲姟銆\x82
ClCompile:
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\bin\HostX64\x64\CL.exe /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D _MBCS /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"cmTC_73365.dir\Debug\\" /Fd"cmTC_73365.dir\Debug\vc143.pdb" /external:W3 /Gd /TP /errorReport:queue "C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\testCXXCompiler.cxx"
鐢ㄤ簬 x64 鐨\x84 Microsoft (R) C/C++ 浼樺寲缂栬瘧鍣\xa8 19.37.32824 鐗\x88
testCXXCompiler.cxx
鐗堟潈鎵\x80鏈\x89(C) Microsoft Corporation銆備繚鐣欐墍鏈夋潈鍒┿\x80\x82
cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D _MBCS /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"cmTC_73365.dir\Debug\\" /Fd"cmTC_73365.dir\Debug\vc143.pdb" /external:W3 /Gd /TP /errorReport:queue "C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\testCXXCompiler.cxx"
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鎸囧畾鐨勪换鍔″彲鎵ц\xa1屾枃浠垛\x80淐L.exe鈥濇湭鑳借繍琛屻\x80係ystem.IO.DirectoryNotFoundException: 鏈\xaa 鑳芥壘鍒拌矾寰勨\x80淐:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.dir\Debug\cmTC_73365.tlog鈥濈 殑涓\x80閮ㄥ垎銆\x82 [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 System.IO.FileSystemEnumerableIterator`1.CommonInit() [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost) [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 System.IO.Directory.GetFiles(String path, String searchPattern) [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 Microsoft.Build.Utilities.TrackedDependencies.ExpandWildcards(ITaskItem[] expand) [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 Microsoft.Build.Utilities.CanonicalTrackedOutputFiles.InternalConstruct(ITask ownerTask, ITaskItem[] tlogFiles, Boolean constructOutputsFromTLogs) [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 Microsoft.Build.CPPTasks.CL.PostExecuteTool(Int32 exitCode) [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 Microsoft.Build.CPPTasks.TrackedVCToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 Microsoft.Build.Utilities.ToolTask.Execute() [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
宸插畬鎴愮敓鎴愰」鐩\xae鈥淐:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj鈥\x9d(榛樿\xaeょ洰鏍\x87)鐨勬搷浣\x9c - 澶辫触銆\x82
鐢熸垚澶辫触銆\x82
鈥淐:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj鈥\x9d(榛樿\xaeょ洰鏍\x87) (1) ->
(PrepareForBuild 鐩\xae鏍\x87) ->
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(541,5): warning MSB8029: 涓\xad闂寸洰褰曟垨杈撳嚭鐩\xae褰曟棤娉曢┗鐣欏湪涓存椂鐩\xae褰曚笅锛屽洜涓鸿繖鍙\xaf鑳戒細瀵艰嚧澧為噺鐢熸垚 鍑虹幇闂\xae棰樸\x80\x82 [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
鈥淐:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj鈥\x9d(榛樿\xaeょ洰鏍\x87) (1) ->
(ClCompile 鐩\xae鏍\x87) ->
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鎸囧畾鐨勪换鍔″彲鎵ц\xa1屾枃浠垛\x80淐L.exe鈥濇湭鑳借繍琛屻\x80係ystem.IO.DirectoryNotFoundException: 鏈\xaa鑳芥壘鍒拌矾寰勨\x80淐:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.dir\Debug\cmTC_73365.tlog鈥濈殑涓\x80閮ㄥ垎銆\x82 [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 System.IO.FileSystemEnumerableIterator`1.CommonInit() [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost) [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 System.IO.Directory.GetFiles(String path, String searchPattern) [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 Microsoft.Build.Utilities.TrackedDependencies.ExpandWildcards(ITaskItem[] expand) [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 Microsoft.Build.Utilities.CanonicalTrackedOutputFiles.InternalConstruct(ITask ownerTask, ITaskItem[] tlogFiles, Boolean constructOutputsFromTLogs) [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 Microsoft.Build.CPPTasks.CL.PostExecuteTool(Int32 exitCode) [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 Microsoft.Build.CPPTasks.TrackedVCToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(741,5): error MSB6003: 鍦\xa8 Microsoft.Build.Utilities.ToolTask.Execute() [C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build\CMakeFiles\CMakeScratch\TryCompile-enjbb7\cmTC_73365.vcxproj]
1 涓\xaa璀﹀憡
1 涓\xaa閿欒\xaf\xaf
宸茬敤鏃堕棿 00:00:00.33
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:120 (enable_language)
-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "C:\Users\verse\AppData\Local\Temp\pip-build-env-idsrka90\overlay\Lib\site-packages\skbuild\setuptools_wrap.py", line 639, in setup
languages=cmake_languages,
File "C:\Users\verse\AppData\Local\Temp\pip-build-env-idsrka90\overlay\Lib\site-packages\skbuild\cmaker.py", line 333, in configure
"An error occurred while configuring with CMake.\n"
An error occurred while configuring with CMake.
Command:
'C:\Users\verse\AppData\Local\Temp\pip-build-env-idsrka90\overlay\Lib\site-packages\cmake\data\bin/cmake.exe' 'C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\opencv' -G 'Visual Studio 17 2022' '-DCMAKE_INSTALL_PREFIX:PATH=C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-install' -DPYTHON_VERSION_STRING:STRING=3.6.13 -DSKBUILD:INTERNAL=TRUE '-DCMAKE_MODULE_PATH:PATH=C:\Users\verse\AppData\Local\Temp\pip-build-env-idsrka90\overlay\Lib\site-packages\skbuild\resources\cmake' '-DPYTHON_EXECUTABLE:PATH=D:\anaconda3\envs\pytorch\python.exe' '-DPYTHON_INCLUDE_DIR:PATH=D:\anaconda3\envs\pytorch\Include' '-DPYTHON_LIBRARY:PATH=D:\anaconda3\envs\pytorch\libs\python36.lib' '-DPython_EXECUTABLE:PATH=D:\anaconda3\envs\pytorch\python.exe' '-DPython_ROOT_DIR:PATH=D:\anaconda3\envs\pytorch' '-DPython_INCLUDE_DIR:PATH=D:\anaconda3\envs\pytorch\Include' -DPython_FIND_REGISTRY:STRING=NEVER '-DPython_NumPy_INCLUDE_DIRS:PATH=C:\Users\verse\AppData\Local\Temp\pip-build-env-idsrka90\overlay\Lib\site-packages\numpy\core\include' '-DPython3_EXECUTABLE:PATH=D:\anaconda3\envs\pytorch\python.exe' '-DPython3_ROOT_DIR:PATH=D:\anaconda3\envs\pytorch' '-DPython3_INCLUDE_DIR:PATH=D:\anaconda3\envs\pytorch\Include' -DPython3_FIND_REGISTRY:STRING=NEVER '-DPython3_NumPy_INCLUDE_DIRS:PATH=C:\Users\verse\AppData\Local\Temp\pip-build-env-idsrka90\overlay\Lib\site-packages\numpy\core\include' -T v143 -A x64 '-DPYTHON3_EXECUTABLE=D:\anaconda3\envs\pytorch\python.exe' '-DPYTHON_DEFAULT_EXECUTABLE=D:\anaconda3\envs\pytorch\python.exe' -DPYTHON3_INCLUDE_DIR=D:/anaconda3/envs/pytorch/Include -DPYTHON3_LIBRARY=D:/anaconda3/envs/pytorch/libs/python36.lib -DBUILD_opencv_python3=ON -DBUILD_opencv_python2=OFF -DBUILD_opencv_java=OFF -DOPENCV_PYTHON3_INSTALL_PATH=python -DINSTALL_CREATE_DISTRIB=ON -DBUILD_opencv_apps=OFF -DBUILD_opencv_freetype=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_DOCS=OFF -DPYTHON3_LIMITED_API=ON -DBUILD_OPENEXR=ON -DCMAKE_GENERATOR_PLATFORM=x64 -DWITH_WIN32UI=OFF -DWITH_QT=OFF -DWITH_GTK=OFF -DCMAKE_BUILD_TYPE:STRING=Release
Source directory:
C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\opencv
Working directory:
C:\Users\verse\AppData\Local\Temp\pip-install-0r8a7kdz\opencv-python-headless_0424c6bf158f4491a240264e96a43d80\_skbuild\win-amd64-3.6\cmake-build
Please see CMake's output for more information.
----------------------------------------
ERROR: Failed building wheel for opencv-python-headless
Failed to build opencv-python-headless
ERROR: Could not build wheels for opencv-python-headless, which is required to install pyproject.toml-based projects
关注最后几句话:
ERROR: Failed building wheel for opencv-python-headless
Failed to build opencv-python-headless
ERROR: Could not build wheels for opencv-python-headless, which is required to install pyproject.toml-based projects
这个错误提示通常是在尝试安装Python包时出现的。它表明安装过程中遇到了问题,导致无法构建opencv-python-headless这个包的“wheel”(轮子),而轮子是预先编译的二进制包,能够加快安装速度。
既然说没有安装opencv-python-headless,我们就自己手动安装opencv-python-headless
方案一:直接在线安装pip install opencv-python-headless
我直接在线安装的话还是报同样的错
方案二:离线安装
去官网下载对应版本的whl文件
https://pypi.org/project/opencv-python-headless/4.1.1.26/#files
注意我们需要下载正确的版本,我们先确认现在需要哪个版本的opencv-python-headless
我们回到前面的安装信息:
- 确定了现在我们需要安装的版本是>=4.1.1的,不要下载低于4.1.1的版本;
- 其次,确定一下所用的python版本,我的是3.6
- 最后,我们要确定一下电脑是32位还是64位的
下载好之后cd到对应的文件夹下,pip install opencv_python_headless-4.1.1.26-cp36-cp36m-win_amd64.whl
安装结束后再安装原来没有安装上的albumentations:pip install albumentations
就可以成功安装了