我正在尝试使用内置终端安装ITK软件包。我确保scikit-build和CMake以及pip都是最新的。 我正在使用Python 3.8,pip版本19.0.3。
运行命令python -m pip install itk
时。这会导致一堆错误和失败的尝试。
Collecting itk
Using cached https://files.pythonhosted.org/packages/b6/73/77f22a4ce19284e687669424dcfa5f8712bccff7c4521d38fbd6025aef21/itk-5.0.1.tar.gz
Building wheels for collected packages: itk
Building wheel for itk (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\s158864\Documents\Uni\Master\Visualization\2IMV20-Visualization\GeneVisualization\venv\Scripts\python.exe' -u -c 'import s
ys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\s158864\\AppData\\Local\\Temp\\pip-install-4l7vqng9\\itk\\setup.py'"'"'; __file__='"'"'C
:\\Users\\s158864\\AppData\\Local\\Temp\\pip-install-4l7vqng9\\itk\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.rea
d().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\s158864\AppData\Loca
l\Temp\pip-wheel-kvu92an4' --python-tag cp38
cwd: C:\Users\s158864\AppData\Local\Temp\pip-install-4l7vqng9\itk\
Complete output (92 lines):
--------------------------------------------------------------------------------
-- Trying "Ninja (Visual Studio 15 2017 v141)" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a
different build tool.
-- Configuring incomplete, errors occurred!
See also "C:/Users/s158864/AppData/Local/Temp/pip-install-4l7vqng9/itk/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying "Ninja (Visual Studio 15 2017 v141)" generator - failure
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Trying "Visual Studio 15 2017 v141" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
-- Selecting Windows SDK version 10.0.16299.0 to target Windows 6.3.9600.
-- The C compiler identification is MSVC 19.15.26729.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.ex
e
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.ex
e -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- The CXX compiler identification is MSVC 19.15.26729.0
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.
exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.
exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/s158864/AppData/Local/Temp/pip-install-4l7vqng9/itk/_cmake_test_compile/build
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying "Visual Studio 15 2017 v141" generator - success
--------------------------------------------------------------------------------
-- Selecting Windows SDK version 10.0.16299.0 to target Windows 6.3.9600.
-- SuperBuild - ITKPythonPackage_WHEEL_NAME:itk
-- SuperBuild -
-- SuperBuild - ITK-source-download
CMake Error at C:/Users/s158864/Documents/Uni/Master/Visualization/2IMV20-Visualization/GeneVisualization/venv/Lib/site-packages/cmake/data/sh
are/cmake-3.15/Modules/ExternalProject.cmake:2410 (message):
error: could not find git for clone of ITK-source-download
Call Stack (most recent call first):
C:/Users/s158864/Documents/Uni/Master/Visualization/2IMV20-Visualization/GeneVisualization/venv/Lib/site-packages/cmake/data/share/cmake-3.1
5/Modules/ExternalProject.cmake:3204 (_ep_add_download_command)
CMakeLists.txt:95 (ExternalProject_add)
-- Configuring incomplete, errors occurred!
See also "C:/Users/s158864/AppData/Local/Temp/pip-install-4l7vqng9/itk/_skbuild/win32-3.8/cmake-build/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "C:\Users\s158864\Documents\Uni\Master\Visualization\2IMV20-Visualization\GeneVisualization\venv\lib\site-packages\skbuild\setuptools_w
rap.py", line 570, in setup
env = cmkr.configure(cmake_args,
File "C:\Users\s158864\Documents\Uni\Master\Visualization\2IMV20-Visualization\GeneVisualization\venv\lib\site-packages\skbuild\cmaker.py",
line 221, in configure
raise SKBuildError(
An error occurred while configuring with CMake.
Command:
"cmake" "C:\Users\s158864\AppData\Local\Temp\pip-install-4l7vqng9\itk" "-G" "Visual Studio 15 2017" "-DCMAKE_INSTALL_PREFIX:PATH=C:\Users\
s158864\AppData\Local\Temp\pip-install-4l7vqng9\itk\_skbuild\win32-3.8\cmake-install" "-DPYTHON_EXECUTABLE:FILEPATH=C:\Users\s158864\Documents\U
ni\Master\Visualization\2IMV20-Visualization\GeneVisualization\venv\Scripts\python.exe" "-DPYTHON_VERSION_STRING:STRING=3.8.0" "-DPYTHON_INCLUDE
_DIR:PATH=C:\Users\s158864\AppData\Local\Programs\Python\Python38-32\Include" "-DPYTHON_LIBRARY:FILEPATH=C:\Users\s158864\AppData\Local\Programs
\Python\Python38-32\libs\python38.lib" "-DSKBUILD:BOOL=TRUE" "-DCMAKE_MODULE_PATH:PATH=C:\Users\s158864\Documents\Uni\Master\Visualization\2IMV2
0-Visualization\GeneVisualization\venv\lib\site-packages\skbuild\resources\cmake" "-DCMAKE_BUILD_TYPE:STRING=Release"
Source directory:
C:\Users\s158864\AppData\Local\Temp\pip-install-4l7vqng9\itk
Working directory:
C:\Users\s158864\AppData\Local\Temp\pip-install-4l7vqng9\itk\_skbuild\win32-3.8\cmake-build
Please see CMake's output for more information.
----------------------------------------
ERROR: Failed building wheel for itk
Running setup.py clean for itk
Failed to build itk
Installing collected packages: itk
Running setup.py install for itk ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\s158864\Documents\Uni\Master\Visualization\2IMV20-Visualization\GeneVisualization\venv\Scripts\python.exe' -u -c 'import
sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\s158864\\AppData\\Local\\Temp\\pip-install-4l7vqng9\\itk\\setup.py'"'"'; __file__='"'"
'C:\\Users\\s158864\\AppData\\Local\\Temp\\pip-install-4l7vqng9\\itk\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.r
ead().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\s158864\AppData\
Local\Temp\pip-record-ps6qjmjf\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\s158864\Documents\U
ni\Master\Visualization\2IMV20-Visualization\GeneVisualization\venv\include\site\python3.8\itk'
cwd: C:\Users\s158864\AppData\Local\Temp\pip-install-4l7vqng9\itk\
Complete output (92 lines):
--------------------------------------------------------------------------------
-- Trying "Ninja (Visual Studio 15 2017 v141)" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select
a different build tool.
-- Configuring incomplete, errors occurred!
See also "C:/Users/s158864/AppData/Local/Temp/pip-install-4l7vqng9/itk/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying "Ninja (Visual Studio 15 2017 v141)" generator - failure
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Trying "Visual Studio 15 2017 v141" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
-- Selecting Windows SDK version 10.0.16299.0 to target Windows 6.3.9600.
-- The C compiler identification is MSVC 19.15.26729.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.
exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.
exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- The CXX compiler identification is MSVC 19.15.26729.0
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/c
l.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/c
l.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/s158864/AppData/Local/Temp/pip-install-4l7vqng9/itk/_cmake_test_compile/build
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying "Visual Studio 15 2017 v141" generator - success
--------------------------------------------------------------------------------
-- Selecting Windows SDK version 10.0.16299.0 to target Windows 6.3.9600.
-- SuperBuild - ITKPythonPackage_WHEEL_NAME:itk
-- SuperBuild -
-- SuperBuild - ITK-source-download
CMake Error at C:/Users/s158864/Documents/Uni/Master/Visualization/2IMV20-Visualization/GeneVisualization/venv/Lib/site-packages/cmake/data/
share/cmake-3.15/Modules/ExternalProject.cmake:2410 (message):
error: could not find git for clone of ITK-source-download
Call Stack (most recent call first):
C:/Users/s158864/Documents/Uni/Master/Visualization/2IMV20-Visualization/GeneVisualization/venv/Lib/site-packages/cmake/data/share/cmake-3
.15/Modules/ExternalProject.cmake:3204 (_ep_add_download_command)
CMakeLists.txt:95 (ExternalProject_add)
-- Configuring incomplete, errors occurred!
See also "C:/Users/s158864/AppData/Local/Temp/pip-install-4l7vqng9/itk/_skbuild/win32-3.8/cmake-build/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "C:\Users\s158864\Documents\Uni\Master\Visualization\2IMV20-Visualization\GeneVisualization\venv\lib\site-packages\skbuild\setuptools
_wrap.py", line 570, in setup
env = cmkr.configure(cmake_args,
File "C:\Users\s158864\Documents\Uni\Master\Visualization\2IMV20-Visualization\GeneVisualization\venv\lib\site-packages\skbuild\cmaker.py"
, line 221, in configure
raise SKBuildError(
An error occurred while configuring with CMake.
Command:
"cmake" "C:\Users\s158864\AppData\Local\Temp\pip-install-4l7vqng9\itk" "-G" "Visual Studio 15 2017" "-DCMAKE_INSTALL_PREFIX:PATH=C:\User
s\s158864\AppData\Local\Temp\pip-install-4l7vqng9\itk\_skbuild\win32-3.8\cmake-install" "-DPYTHON_EXECUTABLE:FILEPATH=C:\Users\s158864\Documents
\Uni\Master\Visualization\2IMV20-Visualization\GeneVisualization\venv\Scripts\python.exe" "-DPYTHON_VERSION_STRING:STRING=3.8.0" "-DPYTHON_INCLU
DE_DIR:PATH=C:\Users\s158864\AppData\Local\Programs\Python\Python38-32\Include" "-DPYTHON_LIBRARY:FILEPATH=C:\Users\s158864\AppData\Local\Progra
ms\Python\Python38-32\libs\python38.lib" "-DSKBUILD:BOOL=TRUE" "-DCMAKE_MODULE_PATH:PATH=C:\Users\s158864\Documents\Uni\Master\Visualization\2IM
V20-Visualization\GeneVisualization\venv\lib\site-packages\skbuild\resources\cmake" "-DCMAKE_BUILD_TYPE:STRING=Release"
Source directory:
C:\Users\s158864\AppData\Local\Temp\pip-install-4l7vqng9\itk
Working directory:
C:\Users\s158864\AppData\Local\Temp\pip-install-4l7vqng9\itk\_skbuild\win32-3.8\cmake-build
Please see CMake's output for more information.
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\s158864\Documents\Uni\Master\Visualization\2IMV20-Visualization\GeneVisualization\venv\
Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\s158864\\AppData\\Local\\Temp\\pip-install-4l7vqng9\\
itk\\setup.py'"'"'; __file__='"'"'C:\\Users\\s158864\\AppData\\Local\\Temp\\pip-install-4l7vqng9\\itk\\setup.py'"'"';f=getattr(tokenize, '"'"'op
en'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --
record 'C:\Users\s158864\AppData\Local\Temp\pip-record-ps6qjmjf\install-record.txt' --single-version-externally-managed --compile --install-head
ers 'C:\Users\s158864\Documents\Uni\Master\Visualization\2IMV20-Visualization\GeneVisualization\venv\include\site\python3.8\itk' Check the logs
for full command output.
由于我是编码的新手,因此无法在线找到任何解决方案/类似问题。我需要ITK软件包才能用于某些编程任务,因此解决此问题至关重要。
请帮助!
答案 0 :(得分:0)
CMake错误:CMake无法找到对应于 “忍者”。 CMAKE_MAKE_PROGRAM未设置。您可能需要选择 一个不同的构建工具。
您似乎需要安装ninja
build tool。可能是这样的:sudo apt-get install ninja-build
,但是确切的命令或一系列步骤取决于您的操作系统。