使用 anaconda 在 windows 上安装 cvxpy:nosetests misrebally 失败

Installing cvxpy on windows with anaconda: failed nosetests misrebally

请慢慢解释我应该做什么。我正在尝试在我的机器上安装 cvxpy。我已经安装了 python、visual studio 构建工具并在命令提示符下进行了尝试,但在尝试安装时出现错误。所以我放弃了这个想法并安装了 anaconda,现在我可以安装但没有通过 nosetests。

(base) C:\Users\Ahmed>pip install --upgrade setuptools
Collecting setuptools
  Using cached https://files.pythonhosted.org/packages/3d/72/1c1498c1e908e0562b1e1cd30012580baa7d33b5b0ffdbeb5fde2462cc71/setuptools-45.2.0-py3-none-any.whl
Installing collected packages: setuptools
  Found existing installation: setuptools 41.4.0
    Uninstalling setuptools-41.4.0:
      Successfully uninstalled setuptools-41.4.0
Successfully installed setuptools-45.2.0

(base) C:\Users\Ahmed>pip uninstall cvxpy
Uninstalling cvxpy-1.0.28:
  Would remove:
    c:\users\ahmed\anaconda3\lib\site-packages\_cvxcore.cp37-win_amd64.pyd
    c:\users\ahmed\anaconda3\lib\site-packages\cvxpy-1.0.28.dist-info\*
    c:\users\ahmed\anaconda3\lib\site-packages\cvxpy\*
    c:\users\ahmed\anaconda3\lib\site-packages\examples\*
Proceed (y/n)? y
  Successfully uninstalled cvxpy-1.0.28
----------------------------------------------------------------------
Ran 2007 tests in 63.686s

FAILED (SKIP=3, errors=14, failures=2)

更新:我无法包含整个日志,因为它太长并且被标记为垃圾邮件。上下文是这样的:我不太记得编程,但我曾经学过。我正在尝试安装 cvxpy 以使用几何编程功能。我使用 cvxpy.org 上的说明在 windows 上进行安装,如下所示:

windows install instructions

并出现以下错误:

C:\Users\Ahmed>pip install cvxpy
Collecting cvxpy
  Using cached cvxpy-1.0.28.tar.gz (947 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting scs>=1.1.3
  Using cached scs-2.1.1-2.tar.gz (157 kB)
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\ahmed\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Ahmed\AppData\Local\Temp\pip-install-bg44_ccb\scs\setup.py'"'"'; __file__='"'"'C:\Users\Ahmed\AppData\Local\Temp\pip-install-bg44_ccb\scs\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Ahmed\AppData\Local\Temp\pip-install-bg44_ccb\scs\pip-egg-info'
         cwd: C:\Users\Ahmed\AppData\Local\Temp\pip-install-bg44_ccb\scs\
    Complete output (100 lines):
    Processing numpy/random\_bounded_integers.pxd.in
    Processing numpy/random\mtrand.pyx
    Traceback (most recent call last):
      File "C:\Users\Ahmed\AppData\Local\Temp\easy_install-uiqw24ti\numpy-1.18.1\tools\cythonize.py", line 61, in process_pyx
        from Cython.Compiler.Version import version as cython_version
    ModuleNotFoundError: No module named 'Cython'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "C:\Users\Ahmed\AppData\Local\Temp\easy_install-uiqw24ti\numpy-1.18.1\tools\cythonize.py", line 238, in <module>
        main()
      File "C:\Users\Ahmed\AppData\Local\Temp\easy_install-uiqw24ti\numpy-1.18.1\tools\cythonize.py", line 234, in main
        find_process_files(root_dir)
      File "C:\Users\Ahmed\AppData\Local\Temp\easy_install-uiqw24ti\numpy-1.18.1\tools\cythonize.py", line 225, in find_process_files
        process(root_dir, fromfile, tofile, function, hash_db)
      File "C:\Users\Ahmed\AppData\Local\Temp\easy_install-uiqw24ti\numpy-1.18.1\tools\cythonize.py", line 191, in process
        processor_function(fromfile, tofile)
      File "C:\Users\Ahmed\AppData\Local\Temp\easy_install-uiqw24ti\numpy-1.18.1\tools\cythonize.py", line 66, in process_pyx
        raise OSError('Cython needs to be installed in Python as a module')
    OSError: Cython needs to be installed in Python as a module
    Running from numpy source directory.
    C:\Users\Ahmed\AppData\Local\Temp\easy_install-uiqw24ti\numpy-1.18.1\setup.py:461: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
      run_build = parse_setuppy_commands()
    Traceback (most recent call last):
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
        yield saved
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "C:\Users\Ahmed\AppData\Local\Temp\easy_install-uiqw24ti\numpy-1.18.1\setup.py", line 488, in <module>
      File "C:\Users\Ahmed\AppData\Local\Temp\easy_install-uiqw24ti\numpy-1.18.1\setup.py", line 469, in setup_package
      File "C:\Users\Ahmed\AppData\Local\Temp\easy_install-uiqw24ti\numpy-1.18.1\setup.py", line 275, in generate_cython
    RuntimeError: Running cythonize failed!

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Ahmed\AppData\Local\Temp\pip-install-bg44_ccb\scs\setup.py", line 229, in <module>
        run_install()
      File "C:\Users\Ahmed\AppData\Local\Temp\pip-install-bg44_ccb\scs\setup.py", line 226, in run_install
        install_scs()
      File "C:\Users\Ahmed\AppData\Local\Temp\pip-install-bg44_ccb\scs\setup.py", line 201, in install_scs
        setup(
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 144, in setup
        _install_setup_requires(attrs)
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 139, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\dist.py", line 716, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 780, in resolve
        dist = best[req.key] = env.best_match(
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 1077, in obtain
        return installer(requirement)
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\dist.py", line 786, in fetch_build_egg
        return cmd.easy_install(req)
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\easy_install.py", line 679, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\easy_install.py", line 705, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\easy_install.py", line 890, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\easy_install.py", line 1158, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\easy_install.py", line 1144, in run_setup
        run_setup(setup_script, args)
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 253, in run_setup
        raise
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\contextlib.py", line 131, in __exit__
        self.gen.throw(type, value, traceback)
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\contextlib.py", line 131, in __exit__
        self.gen.throw(type, value, traceback)
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\_vendor\six.py", line 685, in reraise
        raise value.with_traceback(tb)
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
        yield saved
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "c:\users\ahmed\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "C:\Users\Ahmed\AppData\Local\Temp\easy_install-uiqw24ti\numpy-1.18.1\setup.py", line 488, in <module>
      File "C:\Users\Ahmed\AppData\Local\Temp\easy_install-uiqw24ti\numpy-1.18.1\setup.py", line 469, in setup_package
      File "C:\Users\Ahmed\AppData\Local\Temp\easy_install-uiqw24ti\numpy-1.18.1\setup.py", line 275, in generate_cython
    RuntimeError: Running cythonize failed!
    Namespace(blas64=False, extraverbose=False, float32=False, gpu=False, int32=False, scs=False)
    Cythonizing sources
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

然后我决定使用必须安装的 Anaconda,然后使用以下说明:

Anaconda installation guide

pip 安装没有错误。来自 anaconda 提示的以下错误:

C:\Users\Ahmed>pip install cvxpy
Requirement already satisfied: cvxpy in c:\users\ahmed\anaconda3\lib\site-packages (1.0.28)
Requirement already satisfied: ecos>=2 in c:\users\ahmed\anaconda3\lib\site-packages (from cvxpy) (2.0.7.post1)
Requirement already satisfied: scs>=1.1.3 in c:\users\ahmed\anaconda3\lib\site-packages (from cvxpy) (2.1.1.post2)
Requirement already satisfied: scipy>=1.1.0 in c:\users\ahmed\anaconda3\lib\site-packages (from cvxpy) (1.3.1)
Requirement already satisfied: numpy>=1.15 in c:\users\ahmed\anaconda3\lib\site-packages (from cvxpy) (1.16.5)
Requirement already satisfied: multiprocess in c:\users\ahmed\anaconda3\lib\site-packages (from cvxpy) (0.70.9)
Requirement already satisfied: osqp>=0.4.1 in c:\users\ahmed\anaconda3\lib\site-packages (from cvxpy) (0.6.1)
Requirement already satisfied: dill>=0.3.1 in c:\users\ahmed\anaconda3\lib\site-packages (from multiprocess->cvxpy) (0.3.1.1)
Requirement already satisfied: future in c:\users\ahmed\anaconda3\lib\site-packages (from osqp>=0.4.1->cvxpy) (0.17.1)

鼻子测试错误如下:

======================================================================
ERROR: Test eigenvalue atoms.
----------------------------------------------------------------------
//Traceback left out
cvxpy.error.SolverError: Solver 'SCS' failed. Try another solver, or solve with verbose=True for more information.
-------------------- >> begin captured stdout << ---------------------
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

--------------------- >> end captured stdout << ----------------------

======================================================================
ERROR: Test log det.
----------------------------------------------------------------------
//Traceback left out
    "Try another solver, or solve with verbose=True for more "
cvxpy.error.SolverError: Solver 'SCS' failed. Try another solver, or solve with verbose=True for more information.
-------------------- >> begin captured stdout << ---------------------
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

--------------------- >> end captured stdout << ----------------------

======================================================================
ERROR: Test matrix_frac atom.
----------------------------------------------------------------------
//Traceback left out
    "Try another solver, or solve with verbose=True for more "
cvxpy.error.SolverError: Solver 'SCS' failed. Try another solver, or solve with verbose=True for more information.
-------------------- >> begin captured stdout << ---------------------
----------------------------------------------------------------------------
        SCS v2.1.1 - Splitting Conic Solver
        (c) Brendan O'Donoghue, Stanford University, 2012
----------------------------------------------------------------------------
Lin-sys: sparse-direct, nnz in A = 65
eps = 1.00e-06, alpha = 1.50, max_iters = 7500, normalize = 1, scale = 1.00
acceleration_lookback = 0, rho_x = 1.00e-03
Variables n = 26, constraints m = 46
Cones:  primal zero / dual free vars: 31
        sd vars: 15, sd blks: 1
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
Setup time: 2.11e-04s
Failure:could not initialize work

--------------------- >> end captured stdout << ----------------------

======================================================================
ERROR: Test matrix norms.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\tests\test_complex.py", line 304, in test_matrix_norms
    result = prob.solve()
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\problems\problem.py", line 290, in solve
    return solve_func(self, *args, **kwargs)
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\problems\problem.py", line 575, in _solve
    self.unpack_results(solution, full_chain, inverse_data)
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\problems\problem.py", line 718, in unpack_results
    "Try another solver, or solve with verbose=True for more "
cvxpy.error.SolverError: Solver 'SCS' failed. Try another solver, or solve with verbose=True for more information.
-------------------- >> begin captured stdout << ---------------------
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

--------------------- >> end captured stdout << ----------------------

======================================================================
ERROR: Test Hermitian variables.
----------------------------------------------------------------------
//Traceback left out
    "Try another solver, or solve with verbose=True for more "
cvxpy.error.SolverError: Solver 'SCS' failed. Try another solver, or solve with verbose=True for more information.
-------------------- >> begin captured stdout << ---------------------
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

--------------------- >> end captured stdout << ----------------------

======================================================================
ERROR: Test with special index.
----------------------------------------------------------------------
//Traceback left out
    "Try another solver, or solve with verbose=True for more "
cvxpy.error.SolverError: Solver 'SCS' failed. Try another solver, or solve with verbose=True for more information.
-------------------- >> begin captured stdout << ---------------------
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

--------------------- >> end captured stdout << ----------------------

======================================================================
ERROR: test_gen_lambda_max_matrix_completion (cvxpy.tests.test_dqcp.TestDqcp)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\tests\test_dqcp.py", line 466, in test_gen_lambda_max_matrix_completion
    problem.solve(cp.SCS, qcp=True)
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\problems\problem.py", line 290, in solve
    return solve_func(self, *args, **kwargs)
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\problems\problem.py", line 558, in _solve
    chain.reduce(), solver=solver, verbose=verbose, **kwargs)
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\reductions\solvers\bisection.py", line 167, in bisect
    _solve(lowered_feas, solver)
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\reductions\solvers\bisection.py", line 36, in _solve
    problem.solve(solver=solver)
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\problems\problem.py", line 290, in solve
    return solve_func(self, *args, **kwargs)
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\problems\problem.py", line 575, in _solve
    self.unpack_results(solution, full_chain, inverse_data)
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\problems\problem.py", line 718, in unpack_results
    "Try another solver, or solve with verbose=True for more "
cvxpy.error.SolverError: Solver 'SCS' failed. Try another solver, or solve with verbose=True for more information.
-------------------- >> begin captured stdout << ---------------------
WARN: m less than n, problem likely degenerate
WARN: A->p (column pointers) not strictly increasing, column 7 empty
WARN: A->p (column pointers) not strictly increasing, column 8 empty
WARN: A->p (column pointers) not strictly increasing, column 9 empty
WARN: A->p (column pointers) not strictly increasing, column 11 empty
WARN: A->p (column pointers) not strictly increasing, column 13 empty
WARN: A->p (column pointers) not strictly increasing, column 14 empty
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

--------------------- >> end captured stdout << ----------------------

======================================================================
ERROR: test_log_det (cvxpy.tests.test_examples.TestExamples)
----------------------------------------------------------------------
//Traceback left out
    "Try another solver, or solve with verbose=True for more "
cvxpy.error.SolverError: Solver 'SCS' failed. Try another solver, or solve with verbose=True for more information.
-------------------- >> begin captured stdout << ---------------------
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

--------------------- >> end captured stdout << ----------------------

======================================================================
ERROR: Test a problem with diag.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\tests\test_problem.py", line 1430, in test_diag_prob
    result = prob.solve()
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\problems\problem.py", line 290, in solve
    return solve_func(self, *args, **kwargs)
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\problems\problem.py", line 575, in _solve
    self.unpack_results(solution, full_chain, inverse_data)
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\problems\problem.py", line 718, in unpack_results
    "Try another solver, or solve with verbose=True for more "
cvxpy.error.SolverError: Solver 'SCS' failed. Try another solver, or solve with verbose=True for more information.
-------------------- >> begin captured stdout << ---------------------
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

--------------------- >> end captured stdout << ----------------------

======================================================================
ERROR: Test positive definite constraints.
----------------------------------------------------------------------
//Traceback left out
    "Try another solver, or solve with verbose=True for more "
cvxpy.error.SolverError: Solver 'SCS' failed. Try another solver, or solve with verbose=True for more information.
-------------------- >> begin captured stdout << ---------------------
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

--------------------- >> end captured stdout << ----------------------

======================================================================
ERROR: Test complex matrices.
----------------------------------------------------------------------
//Traceback left out
-------------------- >> begin captured stdout << ---------------------
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

--------------------- >> end captured stdout << ----------------------

======================================================================
ERROR: Test sdp var.
----------------------------------------------------------------------
//Traceback left out
    "Try another solver, or solve with verbose=True for more "
cvxpy.error.SolverError: Solver 'SCS' failed. Try another solver, or solve with verbose=True for more information.
-------------------- >> begin captured stdout << ---------------------
----------------------------------------------------------------------------
        SCS v2.1.1 - Splitting Conic Solver
        (c) Brendan O'Donoghue, Stanford University, 2012
----------------------------------------------------------------------------
Lin-sys: sparse-direct, nnz in A = 15
eps = 1.00e-04, alpha = 1.50, max_iters = 5000, normalize = 1, scale = 1.00
acceleration_lookback = 0, rho_x = 1.00e-03
Variables n = 6, constraints m = 15
Cones:  primal zero / dual free vars: 9
        sd vars: 6, sd blks: 1
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
Setup time: 3.62e-04s
Failure:could not initialize work

--------------------- >> end captured stdout << ----------------------

======================================================================
ERROR: Test sigma_max.
----------------------------------------------------------------------
//Traceback left out
    "Try another solver, or solve with verbose=True for more "
cvxpy.error.SolverError: Solver 'SCS' failed. Try another solver, or solve with verbose=True for more information.
-------------------- >> begin captured stdout << ---------------------
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

--------------------- >> end captured stdout << ----------------------

======================================================================
ERROR: Test that results are symmetric.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\tests\test_semidefinite_vars.py", line 43, in test_symm
    prob.solve()
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\problems\problem.py", line 290, in solve
    return solve_func(self, *args, **kwargs)
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\problems\problem.py", line 575, in _solve
    self.unpack_results(solution, full_chain, inverse_data)
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\problems\problem.py", line 718, in unpack_results
    "Try another solver, or solve with verbose=True for more "
cvxpy.error.SolverError: Solver 'SCS' failed. Try another solver, or solve with verbose=True for more information.
-------------------- >> begin captured stdout << ---------------------
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

--------------------- >> end captured stdout << ----------------------

======================================================================
FAIL: Test silencing and enabling solver messages.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\tests\test_problem.py", line 281, in test_verbose
    assert len(output) == 0
AssertionError:
-------------------- >> begin captured stdout << ---------------------
ECOS
ECOS_BB
OSQP
SCS
ECOS
ECOS_BB
OSQP
SCS

--------------------- >> end captured stdout << ----------------------

======================================================================
FAIL: test_sdp_problem (cvxpy.tests.test_semidefinite_vars.TestSemidefiniteVariable)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\tests\test_semidefinite_vars.py", line 51, in test_sdp_problem
    self.assertAlmostEqual(result, 1, places=4)
  File "C:\Users\Ahmed\Anaconda3\lib\site-packages\cvxpy\tests\base_test.py", line 38, in assertAlmostEqual
    super(BaseTest, self).assertAlmostEqual(a, b, places=places)
AssertionError: 0.999896846515758 != 1 within 4 places (0.00010315348424194681 difference)
-------------------- >> begin captured stdout << ---------------------
WARN: aa_init returned NULL, no acceleration applied.

--------------------- >> end captured stdout << ----------------------

----------------------------------------------------------------------
Ran 2007 tests in 72.683s

FAILED (SKIP=3, errors=14, failures=2)

我终于能够成功安装cvxpy了。我发现这个 github issue 非常有帮助。我最终安装了 Python 3.8(64 位)而不是我偶然安装的(32 位)。我安装了

(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

可以找到预编译的轮子here。只需下载每一个并将其移动到您的工作目录,然后 运行 pip install filename.whl