CVXPY安装问题

时间:2018-06-05 04:35:08

标签: python cvxpy

我尝试使用Python 3.6.5在Windows 10上安装cvxpy。我已经安装了Anaconda 5.2,但包website说,根据我的版本,我应该使用pip

我试过这样做,但我遇到了这些错误。有什么帮助吗?

(base) C:\WINDOWS\system32>pip install cvxpy
Collecting cvxpy
  Using cached https://files.pythonhosted.org/packages/a1/59/2613468ffbbe3a818934d06b81b9f4877fe054afbf4f99d2f43f398a0b34/cvxpy-1.0.3.tar.gz
Requirement already satisfied: osqp in c:\users\aimmi\anaconda3\lib\site-packages (from cvxpy) (0.3.0)
Collecting ecos>=2 (from cvxpy)
  Using cached https://files.pythonhosted.org/packages/b6/b4/988b15513b13e8ea2eac65e97d84221ac515a735a93f046e2a2a3d7863fc/ecos-2.0.5.tar.gz
Collecting scs>=1.1.3 (from cvxpy)
  Using cached https://files.pythonhosted.org/packages/b3/fd/6e01c4f4a69fcc6c3db130ba55572089e78e77ea8c0921a679f9da1ec04c/scs-2.0.2.tar.gz
Collecting multiprocess (from cvxpy)
Requirement already satisfied: fastcache in c:\users\aimmi\anaconda3\lib\site-packages (from cvxpy) (1.0.2)
Requirement already satisfied: six in c:\users\aimmi\anaconda3\lib\site-packages (from cvxpy) (1.11.0)
Requirement already satisfied: toolz in c:\users\aimmi\anaconda3\lib\site-packages (from cvxpy) (0.9.0)
Requirement already satisfied: numpy>=1.13 in c:\users\aimmi\anaconda3\lib\site-packages (from cvxpy) (1.14.3)
Requirement already satisfied: scipy>=0.19 in c:\users\aimmi\anaconda3\lib\site-packages (from cvxpy) (1.1.0)
Requirement already satisfied: future in c:\users\aimmi\anaconda3\lib\site-packages (from osqp->cvxpy) (0.16.0)
Collecting dill>=0.2.6 (from multiprocess->cvxpy)
Collecting pyreadline>=1.7.1 (from dill>=0.2.6->multiprocess->cvxpy)
Building wheels for collected packages: cvxpy, ecos, scs
  Running setup.py bdist_wheel for cvxpy ... done
  Stored in directory: C:\Users\aimmi\AppData\Local\pip\Cache\wheels\2b\60\0b\0c2596528665e21d698d6f84a3406c52044c7b4ca6ac737cf3
  Running setup.py bdist_wheel for ecos ... error
  Complete output from command C:\Users\aimmi\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\aimmi\\AppData\\Local\\Temp\\pip-install-ik2f6v5w\\ecos\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\aimmi\AppData\Local\Temp\pip-wheel-vr8ony5i --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  copying src\ecos.py -> build\lib.win-amd64-3.6
  running build_ext
  building '_ecos' extension
  creating build\temp.win-amd64-3.6
  creating build\temp.win-amd64-3.6\Release
  creating build\temp.win-amd64-3.6\Release\src
  creating build\temp.win-amd64-3.6\Release\ecos
  creating build\temp.win-amd64-3.6\Release\ecos\external
  creating build\temp.win-amd64-3.6\Release\ecos\external\ldl
  creating build\temp.win-amd64-3.6\Release\ecos\external\ldl\src
  creating build\temp.win-amd64-3.6\Release\ecos\src
  creating build\temp.win-amd64-3.6\Release\ecos\external\amd
  creating build\temp.win-amd64-3.6\Release\ecos\external\amd\src
  creating build\temp.win-amd64-3.6\Release\ecos\ecos_bb
  C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -IC:\Users\aimmi\Anaconda3\lib\site-packages\numpy\core\include -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -IC:\Users\aimmi\Anaconda3\include -IC:\Users\aimmi\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcsrc/ecosmodule.c /Fobuild\temp.win-amd64-3.6\Release\src/ecosmodule.obj
  ecosmodule.c
  ecos/include\ecos_bb.h(72): warning C4005: 'INFINITY': macro redefinition
  C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(90): note: see previous definition of 'INFINITY'
  ecos/include\ecos_bb.h(74): warning C4005: 'isinf': macro redefinition
  C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(275): note: see previous definition of 'isinf'
  C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -IC:\Users\aimmi\Anaconda3\lib\site-packages\numpy\core\include -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -IC:\Users\aimmi\Anaconda3\include -IC:\Users\aimmi\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcecos/external/ldl/src/ldl.c /Fobuild\temp.win-amd64-3.6\Release\ecos/external/ldl/src/ldl.obj
  ldl.c
  C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(90): warning C4005: 'INFINITY': macro redefinition
  ecos/external/SuiteSparse_config\../../include/glblopts.h(58): note: see previous definition of 'INFINITY'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(94): warning C4005: 'NAN': macro redefinition
  ecos/external/SuiteSparse_config\../../include/glblopts.h(53): note: see previous definition of 'NAN'
  C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -IC:\Users\aimmi\Anaconda3\lib\site-packages\numpy\core\include -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -IC:\Users\aimmi\Anaconda3\include -IC:\Users\aimmi\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcecos/src/cone.c /Fobuild\temp.win-amd64-3.6\Release\ecos/src/cone.obj
  cone.c
  C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(90): warning C4005: 'INFINITY': macro redefinition
  c:\users\aimmi\appdata\local\temp\pip-install-ik2f6v5w\ecos\ecos\include\glblopts.h(58): note: see previous definition of 'INFINITY'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(94): warning C4005: 'NAN': macro redefinition
  c:\users\aimmi\appdata\local\temp\pip-install-ik2f6v5w\ecos\ecos\include\glblopts.h(53): note: see previous definition of 'NAN'
  C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -IC:\Users\aimmi\Anaconda3\lib\site-packages\numpy\core\include -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -IC:\Users\aimmi\Anaconda3\include -IC:\Users\aimmi\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcecos/src/ctrlc.c /Fobuild\temp.win-amd64-3.6\Release\ecos/src/ctrlc.obj
  ctrlc.c
  C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(90): warning C4005: 'INFINITY': macro redefinition
  c:\users\aimmi\appdata\local\temp\pip-install-ik2f6v5w\ecos\ecos\include\glblopts.h(58): note: see previous definition of 'INFINITY'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(94): warning C4005: 'NAN': macro redefinition
  c:\users\aimmi\appdata\local\temp\pip-install-ik2f6v5w\ecos\ecos\include\glblopts.h(53): note: see previous definition of 'NAN'
  C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -IC:\Users\aimmi\Anaconda3\lib\site-packages\numpy\core\include -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -IC:\Users\aimmi\Anaconda3\include -IC:\Users\aimmi\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcecos/src/ecos.c /Fobuild\temp.win-amd64-3.6\Release\ecos/src/ecos.obj
  ecos.c
  C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(90): warning C4005: 'INFINITY': macro redefinition
  c:\users\aimmi\appdata\local\temp\pip-install-ik2f6v5w\ecos\ecos\include\glblopts.h(58): note: see previous definition of 'INFINITY'
  C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(94): warning C4005: 'NAN': macro redefinition
  c:\users\aimmi\appdata\local\temp\pip-install-ik2f6v5w\ecos\ecos\include\glblopts.h(53): note: see previous definition of 'NAN'
  ecos/src/ecos.c(1093): warning C4013: '_set_output_format' undefined; assuming extern returning int
  ecos/src/ecos.c(1093): error C2065: '_TWO_DIGIT_EXPONENT': undeclared identifier
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

  ----------------------------------------
  Failed building wheel for ecos
  Running setup.py clean for ecos
  Running setup.py bdist_wheel for scs ... done
  Stored in directory: C:\Users\aimmi\AppData\Local\pip\Cache\wheels\ff\f0\aa\530ccd478d7d9900b4e9ef5bc5a39e895ce110bed3d3ac653e
Successfully built cvxpy scs
Failed to build ecos
distributed 1.21.8 requires msgpack, which is not installed.
Installing collected packages: ecos, scs, pyreadline, dill, multiprocess, cvxpy
  Running setup.py install for ecos ... error
    Complete output from command C:\Users\aimmi\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\aimmi\\AppData\\Local\\Temp\\pip-install-ik2f6v5w\\ecos\\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\aimmi\AppData\Local\Temp\pip-record-7dcwoibu\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    copying src\ecos.py -> build\lib.win-amd64-3.6
    running build_ext
    building '_ecos' extension
    creating build\temp.win-amd64-3.6
    creating build\temp.win-amd64-3.6\Release
    creating build\temp.win-amd64-3.6\Release\src
    creating build\temp.win-amd64-3.6\Release\ecos
    creating build\temp.win-amd64-3.6\Release\ecos\external
    creating build\temp.win-amd64-3.6\Release\ecos\external\ldl
    creating build\temp.win-amd64-3.6\Release\ecos\external\ldl\src
    creating build\temp.win-amd64-3.6\Release\ecos\src
    creating build\temp.win-amd64-3.6\Release\ecos\external\amd
    creating build\temp.win-amd64-3.6\Release\ecos\external\amd\src
    creating build\temp.win-amd64-3.6\Release\ecos\ecos_bb
    C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -IC:\Users\aimmi\Anaconda3\lib\site-packages\numpy\core\include -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -IC:\Users\aimmi\Anaconda3\include -IC:\Users\aimmi\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcsrc/ecosmodule.c /Fobuild\temp.win-amd64-3.6\Release\src/ecosmodule.obj
    ecosmodule.c
    ecos/include\ecos_bb.h(72): warning C4005: 'INFINITY': macro redefinition
    C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(90): note: see previous definition of 'INFINITY'
    ecos/include\ecos_bb.h(74): warning C4005: 'isinf': macro redefinition
    C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(275): note: see previous definition of 'isinf'
    C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -IC:\Users\aimmi\Anaconda3\lib\site-packages\numpy\core\include -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -IC:\Users\aimmi\Anaconda3\include -IC:\Users\aimmi\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcecos/external/ldl/src/ldl.c /Fobuild\temp.win-amd64-3.6\Release\ecos/external/ldl/src/ldl.obj
    ldl.c
    C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(90): warning C4005: 'INFINITY': macro redefinition
    ecos/external/SuiteSparse_config\../../include/glblopts.h(58): note: see previous definition of 'INFINITY'
    C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(94): warning C4005: 'NAN': macro redefinition
    ecos/external/SuiteSparse_config\../../include/glblopts.h(53): note: see previous definition of 'NAN'
    C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -IC:\Users\aimmi\Anaconda3\lib\site-packages\numpy\core\include -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -IC:\Users\aimmi\Anaconda3\include -IC:\Users\aimmi\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcecos/src/cone.c /Fobuild\temp.win-amd64-3.6\Release\ecos/src/cone.obj
    cone.c
    C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(90): warning C4005: 'INFINITY': macro redefinition
    c:\users\aimmi\appdata\local\temp\pip-install-ik2f6v5w\ecos\ecos\include\glblopts.h(58): note: see previous definition of 'INFINITY'
    C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(94): warning C4005: 'NAN': macro redefinition
    c:\users\aimmi\appdata\local\temp\pip-install-ik2f6v5w\ecos\ecos\include\glblopts.h(53): note: see previous definition of 'NAN'
    C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -IC:\Users\aimmi\Anaconda3\lib\site-packages\numpy\core\include -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -IC:\Users\aimmi\Anaconda3\include -IC:\Users\aimmi\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcecos/src/ctrlc.c /Fobuild\temp.win-amd64-3.6\Release\ecos/src/ctrlc.obj
    ctrlc.c
    C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(90): warning C4005: 'INFINITY': macro redefinition
    c:\users\aimmi\appdata\local\temp\pip-install-ik2f6v5w\ecos\ecos\include\glblopts.h(58): note: see previous definition of 'INFINITY'
    C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(94): warning C4005: 'NAN': macro redefinition
    c:\users\aimmi\appdata\local\temp\pip-install-ik2f6v5w\ecos\ecos\include\glblopts.h(53): note: see previous definition of 'NAN'
    C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -IC:\Users\aimmi\Anaconda3\lib\site-packages\numpy\core\include -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -IC:\Users\aimmi\Anaconda3\include -IC:\Users\aimmi\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.14.26428\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcecos/src/ecos.c /Fobuild\temp.win-amd64-3.6\Release\ecos/src/ecos.obj
    ecos.c
    C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(90): warning C4005: 'INFINITY': macro redefinition
    c:\users\aimmi\appdata\local\temp\pip-install-ik2f6v5w\ecos\ecos\include\glblopts.h(58): note: see previous definition of 'INFINITY'
    C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(94): warning C4005: 'NAN': macro redefinition
    c:\users\aimmi\appdata\local\temp\pip-install-ik2f6v5w\ecos\ecos\include\glblopts.h(53): note: see previous definition of 'NAN'
    ecos/src/ecos.c(1093): warning C4013: '_set_output_format' undefined; assuming extern returning int
    ecos/src/ecos.c(1093): error C2065: '_TWO_DIGIT_EXPONENT': undeclared identifier
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "C:\Users\aimmi\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\aimmi\\AppData\\Local\\Temp\\pip-install-ik2f6v5w\\ecos\\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\aimmi\AppData\Local\Temp\pip-record-7dcwoibu\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\aimmi\AppData\Local\Temp\pip-install-ik2f6v5w\ecos\

1 个答案:

答案 0 :(得分:2)

这些错误来自使用Microsoft Visual Studio编译ECOS

Imho您需要对ECOS提及here进行更改。这些更改被合并到了开发分支(截至目前大约6周),但是有一个发布候选 ecos 2.0.7rc2 准备就绪。

当您的自动设置抓取 ecos-2.0.5 时,我建议(按此顺序):

pip install ecos==2.0.7rc2
pip install cvxpy

我在这里假设,VS 2015所需的那些变化对于你的VS 2017来说也足够了,但不能保证。

对于替代方案,请考虑this recent approach或设置运行Linux的虚拟机(这是我大部分时间都可以使用的方式)。