Reputation: 1307
I am trying to install one package - cvxpy for python in Windows 10 and keep on getting errors related to C++ 14.0. I have followed similar questions and the answers posted:
I have updated to VS 2022 and the corresponding build tools.
I have installed MSVCv143 and Windows 10 SDK 10.0.19041.0 from build tools and have rebooted the machine.
I have tried to launch the developer shell from the build tools command prompt and ran it as well.
Since the errors are related to lapack and blas with numpy, I have installed a conda environment where the numpy is built with lapack and blas.
Nothing seems to work. The errors I am getting are:
pip install cvxpy
Collecting cvxpy
Using cached cvxpy-1.1.17-cp39-cp39-win_amd64.whl (852 kB)
Requirement already satisfied: scipy>=1.1.0 in c:\users\kusari\appdata\local\programs\python\python39\lib\site-packages (from cvxpy) (1.7.1)
Collecting scs>=1.1.6
Using cached scs-2.1.4.tar.gz (6.6 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting ecos>=2
Using cached ecos-2.0.7.post1.tar.gz (126 kB)
Preparing metadata (setup.py) ... done
Collecting osqp>=0.4.1
Using cached osqp-0.6.2.post0-cp39-cp39-win_amd64.whl (162 kB)
Requirement already satisfied: numpy>=1.15 in c:\users\kusari\appdata\local\programs\python\python39\lib\site-packages (from cvxpy) (1.19.4)
Collecting qdldl
Using cached qdldl-0.1.5.post0-cp39-cp39-win_amd64.whl (74 kB)
Building wheels for collected packages: ecos, scs
Building wheel for ecos (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\kusari\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\kusari\\AppData\\Local\\Temp\\2\\pip-install-rd0d64ho\\ecos_08dde659623a4480b5813511b29f1209\\setup.py'"'"'; __file__='"'"'C:\\Users\\kusari\\AppData\\Local\\Temp\\2\\pip-install-rd0d64ho\\ecos_08dde659623a4480b5813511b29f1209\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\kusari\AppData\Local\Temp\2\pip-wheel-ogl08c5t'
cwd: C:\Users\kusari\AppData\Local\Temp\2\pip-install-rd0d64ho\ecos_08dde659623a4480b5813511b29f1209\
Complete output (12 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\ecos
copying src\ecos\ecos.py -> build\lib.win-amd64-3.9\ecos
copying src\ecos\version.py -> build\lib.win-amd64-3.9\ecos
copying src\ecos\__init__.py -> build\lib.win-amd64-3.9\ecos
running build_ext
building '_ecos' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for ecos
Running setup.py clean for ecos
Building wheel for scs (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\kusari\AppData\Local\Programs\Python\Python39\python.exe' 'C:\Users\kusari\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\kusari\AppData\Local\Temp\2\tmp9qqjrwh5'
cwd: C:\Users\kusari\AppData\Local\Temp\2\pip-install-rd0d64ho\scs_9b8a5ab0fbd7442bab5358ce5e781772
Complete output (82 lines):
Namespace(scs=False, gpu=False, float32=False, extraverbose=False, gpu_atrans=True, int32=False, blas64=False)
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\scs
copying src\__init__.py -> build\lib.win-amd64-3.9\scs
running build_ext
blas_mkl_info:
NOT AVAILABLE
blis_info:
NOT AVAILABLE
openblas_info:
library_dirs = ['D:\\a\\1\\s\\numpy\\build\\openblas_info']
libraries = ['openblas_info']
language = f77
define_macros = [('HAVE_CBLAS', None)]
blas_opt_info:
library_dirs = ['D:\\a\\1\\s\\numpy\\build\\openblas_info']
libraries = ['openblas_info']
language = f77
define_macros = [('HAVE_CBLAS', None)]
lapack_mkl_info:
NOT AVAILABLE
openblas_lapack_info:
library_dirs = ['D:\\a\\1\\s\\numpy\\build\\openblas_lapack_info']
libraries = ['openblas_lapack_info']
language = f77
define_macros = [('HAVE_CBLAS', None)]
lapack_opt_info:
library_dirs = ['D:\\a\\1\\s\\numpy\\build\\openblas_lapack_info']
libraries = ['openblas_lapack_info']
language = f77
define_macros = [('HAVE_CBLAS', None)]
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:\Users\kusari\AppData\Local\Temp\2\pip-build-env-rade5sel\overlay\Lib\site-packages\numpy\distutils\system_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:\Users\kusari\AppData\Local\Temp\2\pip-build-env-rade5sel\overlay\Lib\site-packages\numpy\distutils\system_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:\Users\kusari\AppData\Local\Temp\2\pip-build-env-rade5sel\overlay\Lib\site-packages\numpy\distutils\system_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:\Users\kusari\AppData\Local\Temp\2\pip-build-env-rade5sel\overlay\Lib\site-packages\numpy\distutils\system_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:\Users\kusari\AppData\Local\Temp\2\pip-build-env-rade5sel\overlay\Lib\site-packages\numpy\distutils\system_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))()
{}
{}
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for scs
Failed to build ecos scs
ERROR: Could not build wheels for scs, which is required to install pyproject.toml-based projects
I am unable to install any packages which rely on MSVC internally. Thanks for your help.
Upvotes: 1
Views: 994
Reputation: 287
I was recently struggling with this issue myself, where I had MSVC installed but I could not get python to detect it. This is what solved it for me:
Clear the registry key that is mentioned in this SO thread: https://stackoverflow.com/a/64389979/15379178
In short, there was an invalid path/file that my CMD was trying to load (unrelated to MSVC/Python) that was left there by an anaconda installation I had some time ago, giving me a "The system cannot find the path specified" error and it was causing python to think that I didn't have MSVC installed.
It took me quite some time to realise that the error was unrelated to MSVC/Python (I'd done quite a few reinstalls but to no avail).
Since you mention that you actually have conda installed, this exact solution may not work for you. In that case, I suggest looking at similar things (invalid paths) that may be causing python to be indirectly affected like it was in my case. Hope this helps!
Upvotes: 1