python library scs wheel is failing to build

  pip, python, python-3.x, python-wheel

While trying to install the module PyPortfolioOpt, it failed because he ecos and scs modules failed to build. I fixed the issue with ecos by getting visual studio build tools but scs still keeps failing. Im using a conda environment with python 3.8 and I tried conda install but it couldnt find the package in the default channels. Here is the error message:

C:UsersFranklin Joe>pip install scs
Collecting scs
  Using cached scs-2.1.2.tar.gz (3.5 MB)
Requirement already satisfied: numpy>=1.7 in c:programdataanaconda3libsite-packages (from scs) (1.19.2)
Requirement already satisfied: scipy>=0.13.2 in c:programdataanaconda3libsite-packages (from scs) (1.5.2)
Building wheels for collected packages: scs
  Building wheel for scs (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:ProgramDataAnaconda3python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:UsersFranklin JoeAppDataLocalTemppip-install-ifm96i5vscssetup.py'"'"'; __file__='"'"'C:UsersFranklin JoeAppDataLocalTemppip-install-ifm96i5vscssetup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:UsersFranklin JoeAppDataLocalTemppip-wheel-z7f66io1'
       cwd: C:UsersFranklin JoeAppDataLocalTemppip-install-ifm96i5vscs
  Complete output (79 lines):
  Namespace(blas64=False, extraverbose=False, float32=False, gpu=False, int32=False, scs=False)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating buildlib.win-amd64-3.8
  creating buildlib.win-amd64-3.8scs
  copying src__init__.py -> buildlib.win-amd64-3.8scs
  running build_ext
  blas_mkl_info:
      libraries = ['mkl_rt']
      library_dirs = ['C:/ProgramData/Anaconda3Librarylib']
      define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
      include_dirs = ['C:/ProgramData/Anaconda3Libraryinclude']
  blas_opt_info:
      libraries = ['mkl_rt']
      library_dirs = ['C:/ProgramData/Anaconda3Librarylib']
      define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
      include_dirs = ['C:/ProgramData/Anaconda3Libraryinclude']
  lapack_mkl_info:
      libraries = ['mkl_rt']
      library_dirs = ['C:/ProgramData/Anaconda3Librarylib']
      define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
      include_dirs = ['C:/ProgramData/Anaconda3Libraryinclude']
  lapack_opt_info:
      libraries = ['mkl_rt']
      library_dirs = ['C:/ProgramData/Anaconda3Librarylib']
      define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
      include_dirs = ['C:/ProgramData/Anaconda3Libraryinclude']
  Could not locate executable g77
  Could not locate executable f77
  Could not locate executable ifort
  Could not locate executable ifl
  Could not locate executable f90
  Could not locate executable DF
  Could not locate executable efl
  Could not locate executable gfortran
  Could not locate executable f95
  Could not locate executable g95
  Could not locate executable efort
  Could not locate executable efc
  Could not locate executable flang
  don't know how to compile Fortran code on platform 'nt'
  C:ProgramDataAnaconda3libsite-packagesnumpydistutilssystem_info.py:1914: UserWarning:
      Optimized (vendor) Blas libraries are not found.
      Falls back to netlib Blas library which has worse performance.
      A better performance should be easily gained by switching
      Blas library.
    if self._calc_info(blas):
  C:ProgramDataAnaconda3libsite-packagesnumpydistutilssystem_info.py:1914: UserWarning:
      Blas (http://www.netlib.org/blas/) libraries not found.
      Directories to search for the libraries can be specified in the
      numpy/distutils/site.cfg file (section [blas]) or by setting
      the BLAS environment variable.
    if self._calc_info(blas):
  C:ProgramDataAnaconda3libsite-packagesnumpydistutilssystem_info.py:1914: UserWarning:
      Blas (http://www.netlib.org/blas/) sources not found.
      Directories to search for the sources can be specified in the
      numpy/distutils/site.cfg file (section [blas_src]) or by setting
      the BLAS_SRC environment variable.
    if self._calc_info(blas):
  C:ProgramDataAnaconda3libsite-packagesnumpydistutilssystem_info.py:1748: UserWarning:
      Lapack (http://www.netlib.org/lapack/) libraries not found.
      Directories to search for the libraries can be specified in the
      numpy/distutils/site.cfg file (section [lapack]) or by setting
      the LAPACK environment variable.
    return getattr(self, '_calc_info_{}'.format(name))()
  C:ProgramDataAnaconda3libsite-packagesnumpydistutilssystem_info.py:1748: UserWarning:
      Lapack (http://www.netlib.org/lapack/) sources not found.
      Directories to search for the sources can be specified in the
      numpy/distutils/site.cfg file (section [lapack_src]) or by setting
      the LAPACK_SRC environment variable.
    return getattr(self, '_calc_info_{}'.format(name))()
  cl : Command line warning D9002 : ignoring unknown option '-O3'
  scsmodule.c
  c:programdataanaconda3includepyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
  error: Command "C:Program Files (x86)Microsoft Visual Studio17BuildToolsVCToolsMSVC.16.27023binHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON -DCTRLC=1 -DDLONG=1 -DCOPYAMATRIX -Iscs/include -Iscs/linsys -Iscs/linsys/cpu/direct/ -Iscs/linsys/external/amd -Iscs/linsys/external/dqlql -IC:ProgramDataAnaconda3libsite-packagesnumpycoreinclude -IC:ProgramDataAnaconda3include -IC:ProgramDataAnaconda3include -IC:Program Files (x86)Microsoft Visual Studio17BuildToolsVCToolsMSVC.16.27023include /Tcsrc/scsmodule.c /Fobuildtemp.win-amd64-3.8Releasesrc/scsmodule.obj -O3" failed with exit status 2
  {}
  {}
  ----------------------------------------
  ERROR: Failed building wheel for scs
  Running setup.py clean for scs
Failed to build scs
Installing collected packages: scs
    Running setup.py install for scs ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:ProgramDataAnaconda3python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:UsersFranklin JoeAppDataLocalTemppip-install-ifm96i5vscssetup.py'"'"'; __file__='"'"'C:UsersFranklin JoeAppDataLocalTemppip-install-ifm96i5vscssetup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersFranklin JoeAppDataLocalTemppip-record-tqjx263cinstall-record.txt' --single-version-externally-managed --compile --install-headers 'C:ProgramDataAnaconda3Includescs'
         cwd: C:UsersFranklin JoeAppDataLocalTemppip-install-ifm96i5vscs
    Complete output (79 lines):
    Namespace(blas64=False, extraverbose=False, float32=False, gpu=False, int32=False, scs=False)
    running install
    running build
    running build_py
    creating build
    creating buildlib.win-amd64-3.8
    creating buildlib.win-amd64-3.8scs
    copying src__init__.py -> buildlib.win-amd64-3.8scs
    running build_ext
    blas_mkl_info:
        libraries = ['mkl_rt']
        library_dirs = ['C:/ProgramData/Anaconda3Librarylib']
        define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
        include_dirs = ['C:/ProgramData/Anaconda3Libraryinclude']
    blas_opt_info:
        libraries = ['mkl_rt']
        library_dirs = ['C:/ProgramData/Anaconda3Librarylib']
        define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
        include_dirs = ['C:/ProgramData/Anaconda3Libraryinclude']
    lapack_mkl_info:
        libraries = ['mkl_rt']
        library_dirs = ['C:/ProgramData/Anaconda3Librarylib']
        define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
        include_dirs = ['C:/ProgramData/Anaconda3Libraryinclude']
    lapack_opt_info:
        libraries = ['mkl_rt']
        library_dirs = ['C:/ProgramData/Anaconda3Librarylib']
        define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
        include_dirs = ['C:/ProgramData/Anaconda3Libraryinclude']
    Could not locate executable g77
    Could not locate executable f77
    Could not locate executable ifort
    Could not locate executable ifl
    Could not locate executable f90
    Could not locate executable DF
    Could not locate executable efl
    Could not locate executable gfortran
    Could not locate executable f95
    Could not locate executable g95
    Could not locate executable efort
    Could not locate executable efc
    Could not locate executable flang
    don't know how to compile Fortran code on platform 'nt'
    C:ProgramDataAnaconda3libsite-packagesnumpydistutilssystem_info.py:1914: UserWarning:
        Optimized (vendor) Blas libraries are not found.
        Falls back to netlib Blas library which has worse performance.
        A better performance should be easily gained by switching
        Blas library.
      if self._calc_info(blas):
    C:ProgramDataAnaconda3libsite-packagesnumpydistutilssystem_info.py:1914: UserWarning:
        Blas (http://www.netlib.org/blas/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [blas]) or by setting
        the BLAS environment variable.
      if self._calc_info(blas):
    C:ProgramDataAnaconda3libsite-packagesnumpydistutilssystem_info.py:1914: UserWarning:
        Blas (http://www.netlib.org/blas/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [blas_src]) or by setting
        the BLAS_SRC environment variable.
      if self._calc_info(blas):
    C:ProgramDataAnaconda3libsite-packagesnumpydistutilssystem_info.py:1748: UserWarning:
        Lapack (http://www.netlib.org/lapack/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [lapack]) or by setting
        the LAPACK environment variable.
      return getattr(self, '_calc_info_{}'.format(name))()
    C:ProgramDataAnaconda3libsite-packagesnumpydistutilssystem_info.py:1748: UserWarning:
        Lapack (http://www.netlib.org/lapack/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [lapack_src]) or by setting
        the LAPACK_SRC environment variable.
      return getattr(self, '_calc_info_{}'.format(name))()
    cl : Command line warning D9002 : ignoring unknown option '-O3'
    scsmodule.c
    c:programdataanaconda3includepyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
    error: Command "C:Program Files (x86)Microsoft Visual Studio17BuildToolsVCToolsMSVC.16.27023binHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON -DCTRLC=1 -DDLONG=1 -DCOPYAMATRIX -Iscs/include -Iscs/linsys -Iscs/linsys/cpu/direct/ -Iscs/linsys/external/amd -Iscs/linsys/external/dqlql -IC:ProgramDataAnaconda3libsite-packagesnumpycoreinclude -IC:ProgramDataAnaconda3include -IC:ProgramDataAnaconda3include -IC:Program Files (x86)Microsoft Visual Studio17BuildToolsVCToolsMSVC.16.27023include /Tcsrc/scsmodule.c /Fobuildtemp.win-amd64-3.8Releasesrc/scsmodule.obj -O3" failed with exit status 2
    {}
    {}
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:ProgramDataAnaconda3python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:UsersFranklin JoeAppDataLocalTemppip-install-ifm96i5vscssetup.py'"'"'; __file__='"'"'C:UsersFranklin JoeAppDataLocalTemppip-install-ifm96i5vscssetup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersFranklin JoeAppDataLocalTemppip-record-tqjx263cinstall-record.txt' --single-version-externally-managed --compile --install-headers 'C:ProgramDataAnaconda3Includescs' Check the logs for full command output.

Source: Python-3x Questions

LEAVE A COMMENT