如何在 Windows 10 的 pyomo 的 SolverFactory 中使用“cbc" [英] How to use 'cbc' in pyomo's SolverFactory in Windows 10
问题描述
我一直在尝试在pyomo中使用"cbc"求解器,如下所示:
将pyomo.environ导入为pe求解器= pe.SolverFactory('cbc')结果= Solver.solve(m)
目前,我一直在使用pyomo安装的嵌入式求解器,即'glpk',并且我发现'cbc'在许多情况下都可以做得更好.
我正在使用:python 3.XX
Anaconda环境
Windows 10
Pyomo(通过Conda安装)
通过使用高级求解器来升级pyomo的功能将非常棒!
您将需要单独安装 cbc
以便将其用作可调用库.我认为最好的外观是在这里:
https://github.com/coin-or/Cbc/blob/master/README.md
该自述文件讨论了Windows安装.(我使用mac ...任何一条路径都有些颠簸,但可行)
您可能仍然需要从二进制文件中构建它...不太确定...我在这里不太有经验,也许其他人可以继续学习.
I have been trying to use 'cbc' solver in pyomo as following:
import pyomo.environ as pe
solver = pe.SolverFactory('cbc')
result = solver.solve(m)
Currently, I have been relying on the embedded solver with pyomo installation, which is 'glpk', and I have found that 'cbc' can do better job in many circumstances.
I am using: python 3.XX
Anaconda environment
Windows 10
Pyomo (installed via Conda)
It would be great to upgrade the ability of pyomo by using advanced solver!
You will need to install cbc
separately so that it can be used as a callable library. I think the best place to start to look is here:
https://github.com/coin-or/Cbc/blob/master/README.md
That readme file talks about windows installation. (I use mac...either path is a bit bumpy, but doable)
you may still need to build it from binaries...not too sure... I'm not too experienced here, maybe others can pile on.
这篇关于如何在 Windows 10 的 pyomo 的 SolverFactory 中使用“cbc"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!