cvxpy / ecos pip安装错误
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了cvxpy / ecos pip安装错误相关的知识,希望对你有一定的参考价值。
这是一个临界超级用户问题。我一直在使用pip install <x>
在我的3.6.2安装中添加软件包,来自Windows 10上的powershell。我正在努力安装CVXPY。具体来说,我已经升级了setuptools并安装了visual studio c ++ 14.此外,我按照github用户的建议安装了C ++ 2008:https://github.com/embotech/ecos/issues/53。但是,我无法实现她的其他建议(编辑ecosmodules.c),因为我不认为我从github下载的原始包中存在该文件
下面是我尝试通过pip install ecos
安装密钥依赖项eCos时的回溯。
Collecting ecos
Using cached https://files.pythonhosted.org/packages/b6/b4/988b15513b13e8ea2eac65e97d84221ac515a735a93f046e2a2a3d7863fc/ecos-2.0.5.tar.gz
Requirement already satisfied: numpy>=1.6 in c:python36libsite-packages (from ecos) (1.14.2)
Requirement already satisfied: scipy>=0.9 in c:python36libsite-packages (from ecos) (1.1.0)
Building wheels for collected packages: ecos
Running setup.py bdist_wheel for ecos ... error
Complete output from command c:python36python3.exe -u -c "import setuptools, tokenize;__file__='C:\Users\tpittman\AppData\Local\Temp\pip-install-6n1cuqcw\ecos\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:Users pittmanAppDataLocalTemppip-wheel-cz4uosgf --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating buildlib.win-amd64-3.6
copying srcecos.py -> buildlib.win-amd64-3.6
running build_ext
building '_ecos' extension
creating build emp.win-amd64-3.6
creating build emp.win-amd64-3.6Release
creating build emp.win-amd64-3.6Releasesrc
creating build emp.win-amd64-3.6Releaseecos
creating build emp.win-amd64-3.6Releaseecosexternal
creating build emp.win-amd64-3.6Releaseecosexternalldl
creating build emp.win-amd64-3.6Releaseecosexternalldlsrc
creating build emp.win-amd64-3.6Releaseecossrc
creating build emp.win-amd64-3.6Releaseecosexternalamd
creating build emp.win-amd64-3.6Releaseecosexternalamdsrc
creating build emp.win-amd64-3.6Releaseecosecos_bb
C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428inHostX64x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -Ic:python36libsite-packages
umpycoreinclude -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -Ic:python36include -Ic:python36include "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428Include" "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428ATLMFCInclude" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0um" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0ucrt" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" /Tcsrc/ecosmodule.c /Fobuild emp.win-amd64-3.6Releasesrc/ecosmodule.obj
ecosmodule.c
ecos/includeecos_bb.h(72): warning C4005: 'INFINITY': macro redefinition
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_math.h(90): note: see previous definition of 'INFINITY'
ecos/includeecos_bb.h(74): warning C4005: 'isinf': macro redefinition
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_math.h(275): note: see previous definition of 'isinf'
C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428inHostX64x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -Ic:python36libsite-packages
umpycoreinclude -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -Ic:python36include -Ic:python36include "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428Include" "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428ATLMFCInclude" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0um" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0ucrt" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" /Tcecos/external/ldl/src/ldl.c /Fobuild emp.win-amd64-3.6Releaseecos/external/ldl/src/ldl.obj
ldl.c
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_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 Kits10include10.0.17134.0ucrtcorecrt_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 Studio2017CommunityVCToolsMSVC14.14.26428inHostX64x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -Ic:python36libsite-packages
umpycoreinclude -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -Ic:python36include -Ic:python36include "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428Include" "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428ATLMFCInclude" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0um" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0ucrt" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" /Tcecos/src/cone.c /Fobuild emp.win-amd64-3.6Releaseecos/src/cone.obj
cone.c
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_math.h(90): warning C4005: 'INFINITY': macro redefinition
c:users pittmanappdatalocal emppip-install-6n1cuqcwecosecosincludeglblopts.h(58): note: see previous definition of 'INFINITY'
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_math.h(94): warning C4005: 'NAN': macro redefinition
c:users pittmanappdatalocal emppip-install-6n1cuqcwecosecosincludeglblopts.h(53): note: see previous definition of 'NAN'
C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428inHostX64x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -Ic:python36libsite-packages
umpycoreinclude -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -Ic:python36include -Ic:python36include "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428Include" "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428ATLMFCInclude" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0um" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0ucrt" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" /Tcecos/src/ctrlc.c /Fobuild emp.win-amd64-3.6Releaseecos/src/ctrlc.obj
ctrlc.c
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_math.h(90): warning C4005: 'INFINITY': macro redefinition
c:users pittmanappdatalocal emppip-install-6n1cuqcwecosecosincludeglblopts.h(58): note: see previous definition of 'INFINITY'
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_math.h(94): warning C4005: 'NAN': macro redefinition
c:users pittmanappdatalocal emppip-install-6n1cuqcwecosecosincludeglblopts.h(53): note: see previous definition of 'NAN'
C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428inHostX64x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -Ic:python36libsite-packages
umpycoreinclude -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -Ic:python36include -Ic:python36include "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428Include" "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428ATLMFCInclude" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0um" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0ucrt" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" /Tcecos/src/ecos.c /Fobuild emp.win-amd64-3.6Releaseecos/src/ecos.obj
ecos.c
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_math.h(90): warning C4005: 'INFINITY': macro redefinition
c:users pittmanappdatalocal emppip-install-6n1cuqcwecosecosincludeglblopts.h(58): note: see previous definition of 'INFINITY'
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_math.h(94): warning C4005: 'NAN': macro redefinition
c:users pittmanappdatalocal emppip-install-6n1cuqcwecosecosincludeglblopts.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\Community\VC\Tools\MSVC\14.14.26428\bin\HostX64\x64\cl.exe' failed with exit status 2
----------------------------------------
Failed building wheel for ecos
Running setup.py clean for ecos
Failed to build ecos
Installing collected packages: ecos
Running setup.py install for ecos ... error
Complete output from command c:python36python3.exe -u -c "import setuptools, tokenize;__file__='C:\Users\tpittman\AppData\Local\Temp\pip-install-6n1cuqcw\ecos\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" install --record C:Users pittmanAppDataLocalTemppip-record-ngyh01oqinstall-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating buildlib.win-amd64-3.6
copying srcecos.py -> buildlib.win-amd64-3.6
running build_ext
building '_ecos' extension
creating build emp.win-amd64-3.6
creating build emp.win-amd64-3.6Release
creating build emp.win-amd64-3.6Releasesrc
creating build emp.win-amd64-3.6Releaseecos
creating build emp.win-amd64-3.6Releaseecosexternal
creating build emp.win-amd64-3.6Releaseecosexternalldl
creating build emp.win-amd64-3.6Releaseecosexternalldlsrc
creating build emp.win-amd64-3.6Releaseecossrc
creating build emp.win-amd64-3.6Releaseecosexternalamd
creating build emp.win-amd64-3.6Releaseecosexternalamdsrc
creating build emp.win-amd64-3.6Releaseecosecos_bb
C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428inHostX64x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -Ic:python36libsite-packages
umpycoreinclude -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -Ic:python36include -Ic:python36include "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428Include" "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428ATLMFCInclude" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0um" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0ucrt" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" /Tcsrc/ecosmodule.c /Fobuild emp.win-amd64-3.6Releasesrc/ecosmodule.obj
ecosmodule.c
ecos/includeecos_bb.h(72): warning C4005: 'INFINITY': macro redefinition
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_math.h(90): note: see previous definition of 'INFINITY'
ecos/includeecos_bb.h(74): warning C4005: 'isinf': macro redefinition
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_math.h(275): note: see previous definition of 'isinf'
C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428inHostX64x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -Ic:python36libsite-packages
umpycoreinclude -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -Ic:python36include -Ic:python36include "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428Include" "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428ATLMFCInclude" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0um" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0ucrt" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" /Tcecos/external/ldl/src/ldl.c /Fobuild emp.win-amd64-3.6Releaseecos/external/ldl/src/ldl.obj
ldl.c
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_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 Kits10include10.0.17134.0ucrtcorecrt_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 Studio2017CommunityVCToolsMSVC14.14.26428inHostX64x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -Ic:python36libsite-packages
umpycoreinclude -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -Ic:python36include -Ic:python36include "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428Include" "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428ATLMFCInclude" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0um" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0ucrt" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" /Tcecos/src/cone.c /Fobuild emp.win-amd64-3.6Releaseecos/src/cone.obj
cone.c
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_math.h(90): warning C4005: 'INFINITY': macro redefinition
c:users pittmanappdatalocal emppip-install-6n1cuqcwecosecosincludeglblopts.h(58): note: see previous definition of 'INFINITY'
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_math.h(94): warning C4005: 'NAN': macro redefinition
c:users pittmanappdatalocal emppip-install-6n1cuqcwecosecosincludeglblopts.h(53): note: see previous definition of 'NAN'
C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428inHostX64x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -Ic:python36libsite-packages
umpycoreinclude -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -Ic:python36include -Ic:python36include "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428Include" "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428ATLMFCInclude" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0um" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0ucrt" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" /Tcecos/src/ctrlc.c /Fobuild emp.win-amd64-3.6Releaseecos/src/ctrlc.obj
ctrlc.c
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_math.h(90): warning C4005: 'INFINITY': macro redefinition
c:users pittmanappdatalocal emppip-install-6n1cuqcwecosecosincludeglblopts.h(58): note: see previous definition of 'INFINITY'
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_math.h(94): warning C4005: 'NAN': macro redefinition
c:users pittmanappdatalocal emppip-install-6n1cuqcwecosecosincludeglblopts.h(53): note: see previous definition of 'NAN'
C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428inHostX64x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -DPYTHON -DDLONG -DLDL_LONG -DCTRLC=1 -Iecos/include -Ic:python36libsite-packages
umpycoreinclude -Iecos/external/amd/include -Iecos/external/ldl/include -Iecos/external/SuiteSparse_config -Ic:python36include -Ic:python36include "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428Include" "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428ATLMFCInclude" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0um" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0ucrt" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" /Tcecos/src/ecos.c /Fobuild emp.win-amd64-3.6Releaseecos/src/ecos.obj
ecos.c
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_math.h(90): warning C4005: 'INFINITY': macro redefinition
c:users pittmanappdatalocal emppip-install-6n1cuqcwecosecosincludeglblopts.h(58): note: see previous definition of 'INFINITY'
C:Program Files (x86)Windows Kits10include10.0.17134.0ucrtcorecrt_math.h(94): warning C4005: 'NAN': macro redefinition
c:users pittmanappdatalocal emppip-install-6n1cuqcwecosecosincludeglblopts.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\Community\VC\Tools\MSVC\14.14.26428\bin\HostX64\x64\cl.exe' failed with exit status 2
----------------------------------------
Command "c:python36python3.exe -u -c "import setuptools, tokenize;__file__='C:\Users\tpittman\AppData\Local\Temp\pip-install-6n1cuqcw\ecos\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" install --record C:Users pittmanAppDataLocalTemppip-record-ngyh01oqinstall-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:Users pittmanAppDataLocalTemppip-install-6n1cuqcwecos
在基于Anaconda的Win64 Python36安装上
conda install ecos
为我工作。
其中允许一个pip安装cvxpy。
我认为最好的“解决方案”是使用windows linux子系统。从这里,我能够使用python3 -m pip install cmake
和python3 -m pip install cvxpy
在python 3.5上安装cvxpy和所有依赖项
对于那些没有安装WLS的人来说,这不是微不足道的,而是相对无痛的。 https://docs.microsoft.com/en-us/windows/wsl/install-win10
以上是关于cvxpy / ecos pip安装错误的主要内容,如果未能解决你的问题,请参考以下文章
导入错误和未定义符号:dgesv_ 使用 PIP 安装 CVXPY 时出错
如何在Windows 10上安装GLXK for CVXPY?