Skip to content

Error using gams as solver with pyomo #5

@Otaola93

Description

@Otaola93

When using pyomo, the solver is indicated as:
opt = SolverFactory('solver_name')
solver_name can be any supported solvers as cbc gurobit etc.
However, pyomo also allows to call gams as it was a solver.
For example, to use cplex trough gams we should use:

opt = SolverFactory('gams')
opt.options['solver'] = 'cplex'

However, when gams is specified as solver for pyomo, MOS fails to recognize that pyomo has to be used and not gams directly.
I suppose that the kernel.system is set to gams instead of pyomo. I couldn’t track the error entirely but I tried the following in the containerized demo example:

  • Case A:

opt = SolverFactory('gurobi')
I got an error in the file mos-compute/mos/compute/kernel/pyomo.py because I didn’t have gurobi solver installed

  • Case B:
opt = SolverFactory('gams')
opt.options['solver'] = 'cplex'

I got an error in the file mos-compute/mos/compute/kernel/gams.py because it could not import gams package (that pyomo does not require to be installed)

Obviating that I did not have gurobi installed, it seems clear that MOS is not able to recognize that it should let pyomo call gams and tries to call it directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions