Cvxpy: Python 3 support for Anaconda installation on Windows

Created on 18 May 2018  路  27Comments  路  Source: cvxgrp/cvxpy

Currently it is not possible to build a cvxpy conda package for Python 3 on Windows. The issue is that conda cannot find any version of SCS built for Python 3 on Windows. I find this odd, since I made some here: https://anaconda.org/cvxgrp/scs/files
But for whatever reason they're not getting picked up during conda build.

help wanted

Most helpful comment

I know this isn't exactly fixing the issue, but as a workaround I've been using the precompiled wheels from

https://www.lfd.uci.edu/~gohlke/pythonlibs/

All 27 comments

Hello,

I have spent the past ~5 hours trying to install cvxpy on Windows 10

I tried everything (with Anaconda, with pip, with wheels from different sources, with a combination of Anaconda and pip), and nosetests fail no matter what.

It's the same nosetest error no matter how I try to install:
Install blas+lapack and re-compile SCS with blas+lapack libray locations
ERROR: init_cone failure

It sounds related to the issue you mention in this issue (SCS).

I've really stretched my imagination on this one and I'm stuck.

Could you please help?

This is fine, just don't use SCS. We are working on making SCS easily deployable on windows.

Thanks a lot for the fast response! It definitely saved me from another several hours of hair pulling.

That makes sense -- only the SCS solver is failing.

Perhaps you could mention in the installation procedure for Windows that SCS errors in nosetests are expected for the time being?

This might prevent future amateurs like me from doing some unnecessary debug attempts.

Also I failed to paste the first line of the error message

FATAL: Cannot solve SDPs with > 2x2 matrices without linked blas+lapack libraries
Install blas+lapack and re-compile SCS with blas+lapack libray locations
ERROR: init_cone failure

The first line makes it seem like blas/lapack libraries themselves are missing, not just SCS.

This makes it more likely that Windows users running nosetests will assume their entire cvxpy package is broken, not just a specific solver.

In any case, if the other solvers work I'm happy.

I know this isn't exactly fixing the issue, but as a workaround I've been using the precompiled wheels from

https://www.lfd.uci.edu/~gohlke/pythonlibs/

FYI: I just installed cvxpy using pip install in a python3 conda environment in windows 10, and it seems worked well. I had to manually update anaconda to the latest version to install ecos first though. Some older anaconda versions failed during install ecos.

Is there anything I could do to help here? It would be great to have a Python 3 build for >1.0 on Anaconda 馃槃

We're recommending pip now for Windows.

@SteveDiamond it doesn't work with pip install on Windows. Just got a new pc with Python 3.7 and had to install CVXPY again. SCS is still unable to find BLAS+LAPACK, even though they were installed before SCS. I ended up using the precompiled wheels for SCS as suggested above by @stevenwong to make it work.

@pnystrup do you have any ideas for fixing this issue? @bodono Peter is saying you can't install SCS with Python 3 on Windows. Is that your experience?

@SteveDiamond unfortunately not. I tried a bunch of things yesterday before giving up and going with the precompiled wheels for SCS. At least that is a workaround for now. It's the same issue that has been resolved in the past, e.g. https://github.com/cvxgrp/scs/issues/72. Whatever the solution was in order to make SCS find the BLAS+LAPACK installation on Windows, it needs to happen again. When pip installing CVXPY and SCS it definitely needs to also install LAPACK first.

The version of SCS that's available via conda install from the cvxgrp or oxfordcontrol channels, are pretty old and requires a downgrade to Python 3.6. But it still didn't work for me.

SCS has a python test using appveyor + windows and python 3 that passes:

https://ci.appveyor.com/project/bodono/scs-python/branch/master

SCS relies on numpy to tell it where the blas and lapack libraries live. What happens when you run

import numpy
from numpy.distutils.system_info import get_info
blas_info = get_info('blas_opt')
print(blas_info)
lapack_info = get_info('lapack_opt')
print(lapack_info)

and when you run

import numpy
numpy.show_config()

@bodono That seems to be the issue. Numpy isn't aware, although I have lapack installed in C:Users\Peter\Anaconda3\pkgs\lapack-3.6.1-h8933c1f_2

get_info('blas_opt') gives me:

blas_info = get_info('blas_opt')
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\Peter\Anaconda3\lib\site-packages\numpy\distutils\system_info.py:638: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
self.calc_info()
C:Users\Peter\Anaconda3\lib\site-packages\numpy\distutils\system_info.py:638: 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.
self.calc_info()
C:Users\Peter\Anaconda3\lib\site-packages\numpy\distutils\system_info.py:638: 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.
self.calc_info()

get_info('lapack_opt') gives me:

C:Users\Peter\Anaconda3\lib\site-packages\numpy\distutils\system_info.py:638: 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.
self.calc_info()
C:Users\Peter\Anaconda3\lib\site-packages\numpy\distutils\system_info.py:638: 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.
self.calc_info()

numpy.show_config() returns:

mkl_info:
libraries = ['mkl_rt']
library_dirs = ['C:/Users/Peter/Anaconda3\Library\lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.0.117\windows\mkl', 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.0.117\windows\mkl\include', 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.0.117\windows\mkl\lib', 'C:/Users/Peter/Anaconda3\Library\include']
blas_mkl_info:
libraries = ['mkl_rt']
library_dirs = ['C:/Users/Peter/Anaconda3\Library\lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.0.117\windows\mkl', 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.0.117\windows\mkl\include', 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.0.117\windows\mkl\lib', 'C:/Users/Peter/Anaconda3\Library\include']
blas_opt_info:
libraries = ['mkl_rt']
library_dirs = ['C:/Users/Peter/Anaconda3\Library\lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.0.117\windows\mkl', 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.0.117\windows\mkl\include', 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.0.117\windows\mkl\lib', 'C:/Users/Peter/Anaconda3\Library\include']
lapack_mkl_info:
libraries = ['mkl_rt']
library_dirs = ['C:/Users/Peter/Anaconda3\Library\lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.0.117\windows\mkl', 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.0.117\windows\mkl\include', 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.0.117\windows\mkl\lib', 'C:/Users/Peter/Anaconda3\Library\include']
lapack_opt_info:
libraries = ['mkl_rt']
library_dirs = ['C:/Users/Peter/Anaconda3\Library\lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.0.117\windows\mkl', 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.0.117\windows\mkl\include', 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.0.117\windows\mkl\lib', 'C:/Users/Peter/Anaconda3\Library\include']

If it just searched for lapack and blas in C:/Users/Peter/Anaconda3\Library\lib or in the lapack package directory it would find the files, but instead it's looking in the mkl directory. Any idea why that happens?

I've recently managed to install cvxpy+dependencies on Windows in Anaconda 5.2 (python 3.7). I didn't do anything special - installed VC++ 14.0 standalone compiler as listed here. Then ran

conda install -c oxfordcontrol osqp
pip install cvxpy

And it all seems to work. The only hiccup I ran into was osqp crashing when using MKL but that's unrelated.

@pnystrup MKL is not the problem, on my linux machine it also links against MKL. The problem is that numpy is looking for a fortran compiler for some reason but can't find one. This stackoverflow answer might be of help: https://superuser.com/questions/1399738/pip-error-no-fortran-compiler-found-but-compiler-already-present

@bodono Okay, I obviously have no clue what's going on. The path where it's searching for the compiler is wrong: C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.0.117\windows\mkl

It should be 2019.3.203. Any idea how I can change this?

Did you try installing a fortran compiler? Try:

conda install -c conda-forge fortran-compiler 

and if that doesn't work try:

conda install -c anaconda mingw 

I already have the compilers installed, the issue is that numpy is looking in the wrong places. I have no idea how to change this.

This is clearly a numpy issue rather than a cvxpy / scs problem, so this is probably not the place to discuss this, but you could try setting an environment variable (e.g. MKLROOT) since it seems that numpy does try to respect those, for example here:

https://github.com/numpy/numpy/blob/master/numpy/distutils/system_info.py#L1034

If that doesn't work then you can force SCS to skip the numpy check and use another path by setting two environment variables that point to your desired location:

https://github.com/bodono/scs-python/blob/master/setup.py#L57

BLAS_LAPACK_LIB_PATHS is the path to where the libraries are

BLAS_LAPACK_LIBS are the library names searated by ':' (e.g., 'blas:lapack')

Yes, it's a numpy+mkl issue. Hopefully it'll be resolved in a future version. Thanks for the help! Although it doesn't solve the problem, the precompiled wheels for scs provides a workaround to get a working installation of cvxpy

Thanks everyone for clarifying this! It seems to me that overall installing cvxpy with Python 3 on Windows is satisfactory.

I am having trouble installing cvxpy on windows 10 with python 3. In the regular command prompt I get the following error:

```
C:\MinGW\opt\python3>python -m pip install numpy
Collecting numpy
Using cached https://files.pythonhosted.org/packages/0e/c3/be53614c4e3490778050e1df48fd463837297d5dd402dae3b500f2050eba/numpy-1.18.1-cp38-cp38-win32.whl
Installing collected packages: numpy
WARNING: The script f2py.exe is installed in 'C:\MinGW\opt\python3\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed numpy-1.18.1
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\MinGW\opt\python3>python -m pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 19.2.3
Uninstalling pip-19.2.3:
Successfully uninstalled pip-19.2.3
Successfully installed pip-20.0.2

C:\MinGW\opt\python3>python -m pip install scs
Collecting scs
Using cached scs-2.1.1-2.tar.gz (157 kB)
Requirement already satisfied: numpy>=1.7 in c:\mingw\opt\python3\lib\site-packages (from scs) (1.18.1)
Collecting scipy>=0.13.2
Using cached scipy-1.4.1-cp38-cp38-win32.whl (27.9 MB)
Installing collected packages: scipy, scs
Running setup.py install for scs ... done
Successfully installed scipy-1.4.1 scs-2.1.1.post2

C:\MinGW\opt\python3>python -m pip install cvxpy
Processing c:\users\ahmed\appdata\local\pip\cache\wheels\15\c2\fc\551c045cd3354137f6703e276586f3169ecc51bdff0d1a4e13\cvxpy-1.0.28-cp38-cp38-win32.whl
Requirement already satisfied: scipy>=1.1.0 in c:\mingw\opt\python3\lib\site-packages (from cvxpy) (1.4.1)
Collecting multiprocess
Using cached multiprocess-0.70.9.tar.gz (1.6 MB)
Collecting osqp>=0.4.1
Using cached osqp-0.6.1.tar.gz (211 kB)
Requirement already satisfied: numpy>=1.15 in c:\mingw\opt\python3\lib\site-packages (from cvxpy) (1.18.1)
Collecting ecos>=2
Using cached ecos-2.0.7.post1.tar.gz (126 kB)
Requirement already satisfied: scs>=1.1.3 in c:\mingw\opt\python3\lib\site-packages (from cvxpy) (2.1.1.post2)
Collecting dill>=0.3.1
Using cached dill-0.3.1.1.tar.gz (151 kB)
Collecting future
Using cached future-0.18.2.tar.gz (829 kB)
Installing collected packages: dill, multiprocess, future, osqp, ecos, cvxpy
Running setup.py install for dill ... done
Running setup.py install for multiprocess ... done
Running setup.py install for future ... done
Running setup.py install for osqp ... error
ERROR: Command errored out with exit status 1:
command: 'C:\MinGW\opt\python3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Ahmed\AppData\Local\Temp\pip-install-6i3r9mcf\osqp\setup.py'"'"'; __file__='"'"'C:\Users\Ahmed\AppData\Local\Temp\pip-install-6i3r9mcf\osqp\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:Users\Ahmed\AppData\Local\Temp\pip-record-r5yifg0h\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\MinGW\opt\python3\Include\osqp'
cwd: C:Users\Ahmed\AppData\Local\Temp\pip-install-6i3r9mcf\osqp\
Complete output (124 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
creating build\lib.win32-3.8\osqp
copying module\interface.py -> build\lib.win32-3.8\osqp
copying module\utils.py -> build\lib.win32-3.8\osqp
copying module__init__.py -> build\lib.win32-3.8\osqp
creating build\lib.win32-3.8\osqp\codegen
copying module\codegen\code_generator.py -> build\lib.win32-3.8\osqp\codegen
copying module\codegen\utils.py -> build\lib.win32-3.8\osqp\codegen
copying module\codegen__init__.py -> build\lib.win32-3.8\osqp\codegen
creating build\lib.win32-3.8\osqp\tests
copying module\tests\basic_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\codegen_matrices_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\codegen_vectors_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\dual_infeasibility_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\feasibility_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\mkl_pardiso_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\non_convex_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\polishing_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\primal_infeasibility_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\unconstrained_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\update_matrices_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests\warm_start_test.py -> build\lib.win32-3.8\osqp\tests
copying module\tests__init__.py -> build\lib.win32-3.8\osqp\tests
creating build\lib.win32-3.8\osqppurepy
copying modulepurepy\interface.py -> build\lib.win32-3.8\osqppurepy
copying modulepurepy_osqp.py -> build\lib.win32-3.8\osqppurepy
copying modulepurepy__init__.py -> build\lib.win32-3.8\osqppurepy
running egg_info
writing osqp.egg-info\PKG-INFO
writing dependency_links to osqp.egg-info\dependency_links.txt
writing requirements to osqp.egg-info\requires.txt
writing top-level names to osqp.egg-info\top_level.txt
reading manifest file 'osqp.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'osqp.egg-info\SOURCES.txt'
creating build\lib.win32-3.8\osqp\codegen\files_to_generate
copying module\codegen\files_to_generate\CMakeLists.txt -> build\lib.win32-3.8\osqp\codegen\files_to_generate
copying module\codegen\files_to_generate\emosqpmodule.c -> build\lib.win32-3.8\osqp\codegen\files_to_generate
copying module\codegen\files_to_generate\example.c -> build\lib.win32-3.8\osqp\codegen\files_to_generate
copying module\codegen\files_to_generate\setup.py -> build\lib.win32-3.8\osqp\codegen\files_to_generate
creating build\lib.win32-3.8\osqp\codegen\sources
creating build\lib.win32-3.8\osqp\codegen\sources\configure
copying module\codegen\sources\configure\osqp_configure.h.in -> build\lib.win32-3.8\osqp\codegen\sources\configure
copying module\codegen\sources\configure\qdldl_types.h.in -> build\lib.win32-3.8\osqp\codegen\sources\configure
creating build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\CMakeLists.txt -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\auxil.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\constants.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\error.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\glob_opts.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\kkt.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\lin_alg.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\osqp.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\proj.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\qdldl.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\qdldl_interface.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\scaling.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\types.h -> build\lib.win32-3.8\osqp\codegen\sources\include
copying module\codegen\sources\include\util.h -> build\lib.win32-3.8\osqp\codegen\sources\include
creating build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\CMakeLists.txt -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\auxil.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\error.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\kkt.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\lin_alg.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\osqp.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\proj.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\qdldl.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\qdldl_interface.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\scaling.c -> build\lib.win32-3.8\osqp\codegen\sources\src
copying module\codegen\sources\src\util.c -> build\lib.win32-3.8\osqp\codegen\sources\src
running build_ext
Traceback (most recent call last):
File "C:Users\Ahmed\AppData\Local\Temp\pip-install-6i3r9mcf\osqp\setup.py", line 164, in build_extensions
check_output(['cmake', '--version'])
File "C:\MinGW\opt\python3\lib\subprocess.py", line 411, in check_output
return run(popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\MinGW\opt\python3\lib\subprocess.py", line 489, in run
with Popen(
popenargs, kwargs) as process:
File "C:\MinGW\opt\python3\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\MinGW\opt\python3\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "C:Users\Ahmed\AppData\Local\Temp\pip-install-6i3r9mcf\osqp\setup.py", line 208, in
setup(name='osqp',
File "C:\MinGW\opt\python3\lib\site-packages\setuptools__init__.py", line 145, in setup
return distutils.core.setup(
attrs)
File "C:\MinGW\opt\python3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\MinGW\opt\python3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\MinGW\opt\python3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\MinGW\opt\python3\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\MinGW\opt\python3\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\MinGW\opt\python3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\MinGW\opt\python3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\MinGW\opt\python3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\MinGW\opt\python3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\MinGW\opt\python3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\MinGW\opt\python3\lib\site-packages\setuptools\command\build_ext.py", line 84, in run
_build_ext.run(self)
File "C:\MinGW\opt\python3\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "C:Users\Ahmed\AppData\Local\Temp\pip-install-6i3r9mcf\osqp\setup.py", line 166, in build_extensions
raise RuntimeError("CMake must be installed to build OSQP")
RuntimeError: CMake must be installed to build OSQP
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\MinGW\opt\python3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Ahmed\AppData\Local\Temp\pip-install-6i3r9mcf\osqp\setup.py'"'"'; __file__='"'"'C:\Users\Ahmed\AppData\Local\Temp\pip-install-6i3r9mcf\osqp\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:Users\Ahmed\AppData\Local\Temp\pip-record-r5yifg0h\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\MinGW\opt\python3\Include\osqp' Check the logs for full command output.
````

In Anaconda 3, after doing pip install (numpy, scs, cvxpy) I fail the nosetests because of this:

FATAL: Cannot solve SDPs with > 2x2 matrices without linked blas+lapack libraries Install blas+lapack and re-compile SCS with blas+lapack libray locations ERROR: init_cone failure Failure:could not initialize work

I can't install the pre-compiled wheel in anaconda because of this:

(base) C:\Users\Ahmed>pip install cvxpy-1.0.28-cp38-cp38-win_amd64.whl ERROR: cvxpy-1.0.28-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.

I can't install the pre-compiled wheel in regular command prompt because of this:

C:\MinGW\opt\python3>python -m pip install cvxpy-1.0.28-cp38-cp38-win_amd64.whl ERROR: cvxpy-1.0.28-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.

I know close to nothing when it come to programming so please could you explain the soltion which you have come up with and how to use it

EDIT: I found the answer to my original question

@ahmnelsayed it seems like you've got a 32-bit version of python3.8 installed, and you're trying to install the 64-bit version of the pre-compiled cvxpy wheels.

Are you sure you intended to install a 32-bit version of python? Most system nowadays use 64 bits.

Also, in the Anaconda flow, I found that if you just install the pre-compiled wheel for scs, it should solve the nosetests problem (no need to install the pre-compiled cvxpy wheels). So in your case you want the 32-bit version of scs.

We do not have OSQP wheels ready for python 3.8 yet. However, you can currently find the cvxpy, osqp, ecos, scs wheels for windows here

Thank you all so much. @gobbedy I uninstalled my Python 3.8 (32-bit) and install Python 3.8 (64-bit). I then used the like mentioned by @bstellato and also mentioned earlier here to install (numpy+mkl, scipy, cvxopt, scs, ecos, and osqp) in that order and all from downloaded wheels except for scs which I did using pip install scs I then did pip install nose and then nosetests cvxpy and go the following output:

```

Ran 0 tests in 0.000s

OK
```
I think I can start figuring out how to use cvxpy now. Your help is greatly appreciated.

@ahmnelsayed you're welcome. It seems odd though that nosetests ran 0 tests. That can't be right...

Hi,
I am having serious issues trying to install cvxpy. I use Jupiter NB.
I tried many things..pip install cvxpy fails, I tried installed eco and launch it again and still fails, then I also downloaded the .egg from pypi and put it into the C:Users\Notebook\anaconda3\Lib\site-packages but nothing..
It is 1 day I try to fix this and havent got a clue
My Python version is 3.7.6
The jupiter version is 6.0.3
When I run pip install cvxpy takes ages and never shows anything, keeps running forever or at least after like 2 hours I kill the kernel

I have read around that can be solved by dowgrading the python version but I do not want to do that.
Please can you help me?
Kind regards
Luigi

Was this page helpful?
0 / 5 - 0 ratings