Install Slycot on Windows 10 failing

python -m pip install -U pip
python -m pip install slycot
  • The Slycot installation instruction failed, suggesting that nmake/Ninja couldn't be found, and I should install Visual Studio 2022
  • I installed Visual Studio 2022 Community edition, tried again and got the same error message
  • I then installed "C++ CMake tools for Windows" from "Tools > Get Tools and Features... > Individual Components" in Visual Studio
  • (side note: requiring me to install Visual Studio and then C++ CMake tools for Windows required about 5GB of disk space, which I would say is the opposite of lightweight - isn't there any way this module can be installed from pip using just a standard C/C++ compiler such as MinGW and CMake? For me this would make Slycot a lot more lightweight and the installation process a lot smoother)
  • After installing "C++ CMake tools for Windows", I got the (very verbose) output shown below when running python -m pip install slycot
  • What should I do in order to get the build working?
> python -m pip install slycot
Collecting slycot
  Using cached slycot-0.5.1.tar.gz (3.0 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in c:\program files\python37\lib\site-packages (from slycot) (1.18.1)
Building wheels for collected packages: slycot
  Building wheel for slycot (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for slycot (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [353 lines of output]
     
     
      --------------------------------------------------------------------------------
      -- Trying "Ninja (Visual Studio 17 2022 x64 v143)" generator
      --------------------------------
      ---------------------------
      ----------------------
      -----------------
      ------------
      -------
      --
      Not searching for unused variables given on the command line.
      -- The C compiler identification is MSVC 19.34.31937.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - failed
      -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx86/x64/cl.exe     
      -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx86/x64/cl.exe - broken
      CMake Error at C:/Users/Jake/AppData/Local/Temp/pip-build-env-rwbh8lfd/overlay/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/CMakeTestCCompiler.cmake:70 (message):
        The C compiler
     
          "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx86/x64/cl.exe"
     
        is not able to compile a simple test program.
     
        It fails with the following output:
     
          Change Dir: C:/Users/Jake/AppData/Local/Temp/pip-install-e4wqqvym/slycot_c942b6b612fc4cf2bc8380d816096410/_cmake_test_compile/build/CMakeFiles/CMakeScratch/TryCompile-3lflc1
     
          Run Build Command(s):C:/PROGRA~1/MIB055~1/2022/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe cmTC_dd321 && [1/2] Building C object CMakeFiles\cmTC_dd321.dir\testCCompiler.c.obj
          [2/2] Linking C executable cmTC_dd321.exe
          FAILED: cmTC_dd321.exe
          cmd.exe /C "cd . && C:\Users\Jake\AppData\Local\Temp\pip-build-env-rwbh8lfd\overlay\Lib\site-packages\cmake\data\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_dd321.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests  -- C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1434~1.319\bin\Hostx86\x64\link.exe /nologo CMakeFiles\cmTC_dd321.dir\testCCompiler.c.obj  /out:cmTC_dd321.exe /implib:cmTC_dd321.lib /pdb:cmTC_dd321.pdb /version:0.0 /machine:x64  /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
          RC Pass 1: command "rc /fo CMakeFiles\cmTC_dd321.dir/manifest.res CMakeFiles\cmTC_dd321.dir/manifest.rc" failed (exit code 0) with the following output:
          The system cannot find the file specified
          ninja: build stopped: subcommand failed.
     
     
     
     
     
        CMake will not be able to correctly generate this project.
      Call Stack (most recent call first):
        CMakeLists.txt:3 (ENABLE_LANGUAGE)
     
     
      -- Configuring incomplete, errors occurred!
      See also "C:/Users/Jake/AppData/Local/Temp/pip-install-e4wqqvym/slycot_c942b6b612fc4cf2bc8380d816096410/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
      See also "C:/Users/Jake/AppData/Local/Temp/pip-install-e4wqqvym/slycot_c942b6b612fc4cf2bc8380d816096410/_cmake_test_compile/build/CMakeFiles/CMakeError.log".
      --
      -------
      ------------
      -----------------
      ----------------------
      ---------------------------
      --------------------------------
      -- 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.
      -- Selecting Windows SDK version  to target Windows 10.0.19044.
      -- The C compiler identification is unknown
      CMake Error at CMakeLists.txt:3 (ENABLE_LANGUAGE):
        No CMAKE_C_COMPILER could be found.
     
     
     
      -- Configuring incomplete, errors occurred!
      See also "C:/Users/Jake/AppData/Local/Temp/pip-install-e4wqqvym/slycot_c942b6b612fc4cf2bc8380d816096410/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
      See also "C:/Users/Jake/AppData/Local/Temp/pip-install-e4wqqvym/slycot_c942b6b612fc4cf2bc8380d816096410/_cmake_test_compile/build/CMakeFiles/CMakeError.log".
      --
      -------
      ------------
      -----------------
      ----------------------
      ---------------------------
      --------------------------------
      -- Trying "Visual Studio 17 2022 x64 v143" generator - failure
      --------------------------------------------------------------------------------
     
     
     
      --------------------------------------------------------------------------------
      -- Trying "Ninja (Visual Studio 16 2019 x64 v142)" 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/Jake/AppData/Local/Temp/pip-install-e4wqqvym/slycot_c942b6b612fc4cf2bc8380d816096410/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
      --
      -------
      ------------
      -----------------
      ----------------------
      ---------------------------
      --------------------------------
      -- Trying "Ninja (Visual Studio 16 2019 x64 v142)" generator - failure
      --------------------------------------------------------------------------------
      
     
     
      --------------------------------------------------------------------------------
      -- Trying "Visual Studio 16 2019 x64 v142" generator
      --------------------------------
      ---------------------------
      ----------------------
      -----------------
      ------------
      -------
      --
      Not searching for unused variables given on the command line.
      CMake Error at CMakeLists.txt:2 (PROJECT):
        Generator
     
          Visual Studio 16 2019
     
        could not find any instance of Visual Studio.
     
     
     
      -- Configuring incomplete, errors occurred!
      See also "C:/Users/Jake/AppData/Local/Temp/pip-install-e4wqqvym/slycot_c942b6b612fc4cf2bc8380d816096410/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
      --
      -------
      ------------
      -----------------
      ----------------------
      ---------------------------
      --------------------------------
      -- Trying "Visual Studio 16 2019 x64 v142" generator - failure
      --------------------------------------------------------------------------------
     
     
     
      --------------------------------------------------------------------------------
      -- Trying "Ninja (Visual Studio 15 2017 x64 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/Jake/AppData/Local/Temp/pip-install-e4wqqvym/slycot_c942b6b612fc4cf2bc8380d816096410/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
      --
      -------
      ------------
      -----------------
      ----------------------
      ---------------------------
      --------------------------------
      -- Trying "Ninja (Visual Studio 15 2017 x64 v141)" generator - failure
      --------------------------------------------------------------------------------
     
     
     
      --------------------------------------------------------------------------------
      -- Trying "Visual Studio 15 2017 x64 v141" generator
      --------------------------------
      ---------------------------
      ----------------------
      -----------------
      ------------
      -------
      --
      Not searching for unused variables given on the command line.
      CMake Error at CMakeLists.txt:2 (PROJECT):
        Generator
     
          Visual Studio 15 2017
     
        could not find any instance of Visual Studio.
     
     
     
      -- Configuring incomplete, errors occurred!
      See also "C:/Users/Jake/AppData/Local/Temp/pip-install-e4wqqvym/slycot_c942b6b612fc4cf2bc8380d816096410/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
      --
      -------
      ------------
      -----------------
      ----------------------
      ---------------------------
      --------------------------------
      -- Trying "Visual Studio 15 2017 x64 v141" generator - failure
      --------------------------------------------------------------------------------
     
     
     
      --------------------------------------------------------------------------------
      -- Trying "NMake Makefiles (Visual Studio 17 2022 x64 v143)" generator
      --------------------------------
      ---------------------------
      ----------------------
      -----------------
      ------------
      -------
      --
      Not searching for unused variables given on the command line.
      -- The C compiler identification is MSVC 19.34.31937.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - failed
      -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx86/x64/cl.exe     
      -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx86/x64/cl.exe - broken
      CMake Error at C:/Users/Jake/AppData/Local/Temp/pip-build-env-rwbh8lfd/overlay/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/CMakeTestCCompiler.cmake:70 (message):
        The C compiler
      
          "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx86/x64/cl.exe"
     
        is not able to compile a simple test program.
     
        It fails with the following output:
     
          Change Dir: C:/Users/Jake/AppData/Local/Temp/pip-install-e4wqqvym/slycot_c942b6b612fc4cf2bc8380d816096410/_cmake_test_compile/build/CMakeFiles/CMakeScratch/TryCompile-ghppg6
     
          Run Build Command(s):nmake -f Makefile /nologo cmTC_25914\fast &&       "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\nmake.exe"  -f CMakeFiles\cmTC_25914.dir\build.make /nologo -L                  CMakeFiles\cmTC_25914.dir\build    
          Building C object CMakeFiles/cmTC_25914.dir/testCCompiler.c.obj
                  C:\Users\Jake\AppData\Local\Temp\pip-build-env-rwbh8lfd\overlay\Lib\site-packages\cmake\data\bin\cmake.exe -E cmake_cl_compile_depends --dep-file=CMakeFiles\cmTC_25914.dir\testCCompiler.c.obj.d --working-dir=C:\Users\Jake\AppData\Local\Temp\pip-install-e4wqqvym\slycot_c942b6b612fc4cf2bc8380d816096410\_cmake_test_compile\build\CMakeFiles\CMakeScratch\TryCompile-ghppg6 --filter-prefix="Note: including file: " -- C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1434~1.319\bin\Hostx86\x64\cl.exe @C:\Users\Jake\AppData\Local\Temp\nmF0B9.tmp
          testCCompiler.c
          Linking C executable cmTC_25914.exe
                  C:\Users\Jake\AppData\Local\Temp\pip-build-env-rwbh8lfd\overlay\Lib\site-packages\cmake\data\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_25914.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1434~1.319\bin\Hostx86\x64\link.exe /nologo @CMakeFiles\cmTC_25914.dir\objects1 @C:\Users\Jake\AppData\Local\Temp\nmF118.tmp
          RC Pass 1: command "rc /fo CMakeFiles\cmTC_25914.dir/manifest.res CMakeFiles\cmTC_25914.dir/manifest.rc" failed (exit code 0) with the following output:
          The system cannot find the file specifiedNMAKE : fatal error U1077: 'C:\Users\Jake\AppData\Local\Temp\pip-build-env-rwbh8lfd\overlay\Lib\site-packages\cmake\data\bin\cmake.exe' : return code '0xffffffff'
          Stop.
          NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\nmake.exe"' : return code '0x2'
          Stop.
     
     
     
     
     
        CMake will not be able to correctly generate this project.
      Call Stack (most recent call first):
        CMakeLists.txt:3 (ENABLE_LANGUAGE)
     
     
      -- Configuring incomplete, errors occurred!
      See also "C:/Users/Jake/AppData/Local/Temp/pip-install-e4wqqvym/slycot_c942b6b612fc4cf2bc8380d816096410/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
      See also "C:/Users/Jake/AppData/Local/Temp/pip-install-e4wqqvym/slycot_c942b6b612fc4cf2bc8380d816096410/_cmake_test_compile/build/CMakeFiles/CMakeError.log".
      --
      -------
      ------------
      -----------------
      ----------------------
      ---------------------------
      --------------------------------
      -- Trying "NMake Makefiles (Visual Studio 17 2022 x64 v143)" generator - failure
      --------------------------------------------------------------------------------
     
     
     
      --------------------------------------------------------------------------------
      -- Trying "NMake Makefiles (Visual Studio 16 2019 x64 v142)" generator
      --------------------------------
      ---------------------------
      ----------------------
      -----------------
      ------------
      -------
      --
      Not searching for unused variables given on the command line.
      CMake Error at CMakeLists.txt:2 (PROJECT):
        Running
     
         'nmake' '-?'
     
        failed with:
     
         The system cannot find the file specified
     
     
      -- Configuring incomplete, errors occurred!
      See also "C:/Users/Jake/AppData/Local/Temp/pip-install-e4wqqvym/slycot_c942b6b612fc4cf2bc8380d816096410/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
      --
      -------
      ------------
      -----------------
      ----------------------
      ---------------------------
      --------------------------------
      -- Trying "NMake Makefiles (Visual Studio 16 2019 x64 v142)" generator - failure
      --------------------------------------------------------------------------------
     
     
     
      --------------------------------------------------------------------------------
      -- Trying "NMake Makefiles (Visual Studio 15 2017 x64 v141)" generator
      --------------------------------
      ---------------------------
      ----------------------
      -----------------
      ------------
      -------
      --
      Not searching for unused variables given on the command line.
      CMake Error at CMakeLists.txt:2 (PROJECT):
        Running
     
         'nmake' '-?'
     
        failed with:
     
         The system cannot find the file specified
     
      
      -- Configuring incomplete, errors occurred!
      See also "C:/Users/Jake/AppData/Local/Temp/pip-install-e4wqqvym/slycot_c942b6b612fc4cf2bc8380d816096410/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
      --
      -------
      ------------
      -----------------
      ----------------------
      ---------------------------
      --------------------------------
      -- Trying "NMake Makefiles (Visual Studio 15 2017 x64 v141)" generator - failure
      --------------------------------------------------------------------------------
     
      ********************************************************************************
      scikit-build could not get a working generator for your system. Aborting build.
     
      Building windows wheels for Python 3.7 requires Microsoft Visual Studio 2022.
      Get it with "Visual Studio 2017":
     
        https://visualstudio.microsoft.com/vs/
     
      Or with "Visual Studio 2019":
     
     
      Or with "Visual Studio 2022":
     
          https://visualstudio.microsoft.com/vs/
     
      ********************************************************************************
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for slycot
Failed to build slycot
ERROR: Could not build wheels for slycot, which is required to install pyproject.toml-based projects