简体   繁体   中英

PyCharm unable to install ITK package. CMake gives an error

I'm trying to install the ITK package using the built-in terminal. I made sure that both scikit-build and CMake are up to date, as well as pip. I'm using Python 3.8, pip version 19.0.3.

When running the command python -m pip install itk . This results in a long list of errors and failed attempts.

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.

As I'm quite new to coding and can't find any solution/similar problem online I'm stuck. The ITK package is required for me to use with some programming assignments so it is essential that this problem is resolved.

Please help!

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.

It looks like you need to install ninja build tool . Maybe like this: sudo apt-get install ninja-build , but the exact command or series of steps depends on your operating system.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM