Repository navigation
Issues installing slycot via pip #155
Copy link
Copy link
Closed
Labels
build systemIssues with compiling, linking and installing SlycotIssues with compiling, linking and installing Slycot
Description
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!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
build systemIssues with compiling, linking and installing SlycotIssues with compiling, linking and installing Slycot
Activity
bnavigator commentedon May 17, 2021
Hi,
Because we do not provide Slycot wheels on PyPI,
pip install slycottries 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:
This is what the README is referring to by
Windows users are encouraged to make use of the pre-built packages on conda-forge.
bnavigator commentedon May 29, 2021
Closing, because this is not really a bug in Slycot.
OrangeDog commentedon Dec 17, 2021
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
roryyorke commentedon Dec 18, 2021
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.
bnavigator commentedon Dec 18, 2021
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.
RGD2 commentedon Sep 3, 2025
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.
RGD2 commentedon Sep 4, 2025
bnavigator commentedon Sep 4, 2025
You may have missed that SLICOT is written in fortran.