问题
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!
回答1:
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.
来源:https://stackoverflow.com/questions/62645255/how-to-use-cbc-in-pyomos-solverfactory-in-windows-10