Skip to content

Issues installing slycot via pip #155

Description

@PSchneider96

Hello,

Currently trying to install slycot with "pip install slycot"

While running "pip install slycot", I get the following output:

================================================================================
_C:\Windows\system32>pip install slycot
Collecting slycot
  Using cached slycot-0.4.0.0.tar.gz (1.5 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: numpy in c:\users\psc\appdata\local\programs\python\python39\lib\site-packages (from slycot) (1.20.3)
Building wheels for collected packages: slycot
  Building wheel for slycot (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\psc\appdata\local\programs\python\python39\python.exe' 'c:\users\psc\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\psc\AppData\Local\Temp\tmp_pm1h_ju'
       cwd: C:\Users\psc\AppData\Local\Temp\pip-install-g41g7ty1\slycot_37cc017271c84d17ac02eef4e57cb82e
  Complete output (56 lines):
  Not searching for unused variables given on the command line.
  -- The C compiler identification is unknown
  CMake Error at CMakeLists.txt:3 (ENABLE_LANGUAGE):
    The CMAKE_C_COMPILER:

      cl

    is not a full path and was not found in the PATH.

    To use the NMake generator with Visual C++, cmake must be run from a shell
    that can use the compiler cl from the command line.  This environment is
    unable to invoke the cl compiler.  To fix this problem, run cmake from the
    Visual Studio Command Prompt (vcvarsall.bat).

    Tell CMake where to find the compiler by setting either the environment
    variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
    the compiler, or to the compiler name if it is in the PATH.


  -- Configuring incomplete, errors occurred!
  See also "C:/Users/psc/AppData/Local/Temp/pip-install-g41g7ty1/slycot_37cc017271c84d17ac02eef4e57cb82e/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  See also "C:/Users/psc/AppData/Local/Temp/pip-install-g41g7ty1/slycot_37cc017271c84d17ac02eef4e57cb82e/_cmake_test_compile/build/CMakeFiles/CMakeError.log".
  FC ('-DCMAKE_Fortran_COMPILER=', 'c:/users/psc/appdata/local/programs/python/python39/Library/bin/flang.exe')
  F2PY ('-DF2PY_EXECUTABLE=', 'c:/users/psc/appdata/local/programs/python/python39/Scripts/f2py.exe')
  NUMPY_INCLUDE ('-DNumPy_INCLUDE_DIR=', 'c:/users/psc/appdata/local/programs/python/python39/Include')
  ['-DSLYCOT_VERSION:STRING=0.4.0', '-DGIT_REVISION:STRING=ac0944b363a6cfcc0c3d5128cdd484d74173aa3b', '-DISRELEASE:STRING=True', '-DFULL_VERSION=0.4.0.gitac0944b', '-GNMake Makefiles', '-DCMAKE_Fortran_COMPILER=c:/users/psc/appdata/local/programs/python/python39/Library/bin/flang.exe', '-DF2PY_EXECUTABLE=c:/users/psc/appdata/local/programs/python/python39/Scripts/f2py.exe', '-DNumPy_INCLUDE_DIR=c:/users/psc/appdata/local/programs/python/python39/Include', '-DCMAKE_Fortran_SIMULATE_VERSION=5.0.0', '-DCMAKE_Fortran_COMPILER_ID=Flang', '-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON']


  --------------------------------------------------------------------------------
  -- Trying "NMake Makefiles (Visual Studio 15 2017 Win64 v141)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "NMake Makefiles (Visual Studio 15 2017 Win64 v141)" generator - failure
  --------------------------------------------------------------------------------

  ********************************************************************************
  scikit-build could not get a working generator for your system. Aborting build.

  Building windows wheels for Python 3.9 requires Microsoft Visual Studio 2017.
  Get it with "Visual Studio 2017":

    https://visualstudio.microsoft.com/vs/

  ********************************************************************************
  ----------------------------------------
  ERROR: Failed building wheel for slycot
Failed to build slycot
ERROR: Could not build wheels for slycot which use PEP 517 and cannot be installed directly_
================================================================================

However, I cannot make sense of the output. I installed VS 2017 with the correct version v141.
(I run this code in cmd, VS, ... same issue)

Is there something else to do? Set path for VS or CMake,...?

Thanks!

Activity

  1. bnavigator commented on May 17, 2021

    @bnavigator
    Collaborator

    Hi,

    Because we do not provide Slycot wheels on PyPI, pip install slycot tries to compile the source distribution.

    As the README says, compiling from source on Windows is tricky.

    https://github.com/python-control/Slycot/blob/master/README.rst#with-setuptools-in-a-conda-environment-windows

    If you choose to not use conda as your environment, it is even trickier to get all the build requirements: BLAS/LAPACK headers, Numpy and Python headers, and most importantly a working build toolchain where NMake can find the VS C compiler.

    The error message should give you a pointer into the right direction:

       The CMAKE_C_COMPILER:
    
         cl
    
       is not a full path and was not found in the PATH.
    
       To use the NMake generator with Visual C++, cmake must be run from a shell
       that can use the compiler cl from the command line.  This environment is
       unable to invoke the cl compiler.  To fix this problem, run cmake from the
       Visual Studio Command Prompt (vcvarsall.bat).
    
       Tell CMake where to find the compiler by setting either the environment
       variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
       the compiler, or to the compiler name if it is in the PATH.
    

    This is what the README is referring to by

    On Windows, you need to install Microsoft Visual C++ 14.x provided e.g.
    by Microsoft Visual Studio. To build, you'll need a command shell setup
    for ... the Visual Studio build tools. See ... Microsoft Visual Studio setup for information on this.

    Windows users are encouraged to make use of the pre-built packages on conda-forge.

  2. bnavigator commented on May 29, 2021

    @bnavigator
    Collaborator

    Closing, because this is not really a bug in Slycot.

  3. OrangeDog commented on Dec 17, 2021

    @OrangeDog

    we do not provide Slycot wheels on PyPI

    Could you? It would be very helpful and save a huge amount of effort of everyone trying to build it themselves.

    There are some available here, for others who might be looking
    https://www.lfd.uci.edu/~gohlke/pythonlibs/#slycot

  4. roryyorke commented on Dec 18, 2021

    @roryyorke
    Collaborator

    We don't publish wheels because we don't know how to build them.

    I've tried and failed to build wheels for Windows before; if I recall correctly one basically has to bundle a BLAS&LAPACK library in the wheel, and I couldn't figure out how to do it.

  5. bnavigator commented on Dec 18, 2021

    @bnavigator
    Collaborator

    The wheels linked above also depend on a consistent environment with all those packages.

    The situation might have changed for the better since the last time it was attempted to also build wheels for Slycot. NumPy publishes wheels on PyPI too. If someone can come up with a reliable method to publish wheels compatible with those, feel free to contribute.

    I am not a big fan of Anaconda, but for Windows, it is the best thing you can get. It solves all the problems of getting a compiled Slycot working with a BLAS/LAPACK which is also compatible with the used NumPy.

  6. RGD2 commented on Sep 3, 2025

    @RGD2

    We don't publish wheels because we don't know how to build them.

    I've tried and failed to build wheels for Windows before; if I recall correctly one basically has to bundle a BLAS&LAPACK library in the wheel, and I couldn't figure out how to do it.

    You may want to consider switching to using the BLAS compatibility layer of BLIS - which is written in pure C99 with no dependancies.

    This also removes needing a fortran compiler.

  7. RGD2 commented on Sep 4, 2025

    @RGD2
  8. bnavigator commented on Sep 4, 2025

    @bnavigator
    Collaborator

    This also removes needing a fortran compiler.

    You may have missed that SLICOT is written in fortran.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    build systemIssues with compiling, linking and installing Slycot

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions