Bindings for CPLEX and GLPK in Pyomo 5.1.1 and 5.2

300 views
Skip to first unread message

Carlos Suazo M.

unread,
Sep 15, 2017, 9:40:18 AM9/15/17
to Pyomo Forum
Guys,

I'm trying to use python bindings for CPLEX and GLPK in Pyomo 5.1.1 and 5.2 --> opt = SolverFactory('glpk', solver_io='python') and I'm getting this error:

  File "main.py", line 94, in <module>

    results_master = opt.solve(instancia_modelo, tee=True)

  File "/Library/Python/2.7/site-packages/pyomo/opt/base/solvers.py", line 127, in solve

    self._solver_error('solve')

  File "/Library/Python/2.7/site-packages/pyomo/opt/base/solvers.py", line 155, in _solver_error

    + "\n\toptions: %s" % ( self.options, ) )

RuntimeError: Attempting to use an unavailable solver.


The SolverFactory was unable to create the solver "_glpk_direct"

and returned an UnknownSolver object.  This error is raised at the point

where the UnknownSolver object was used as if it were valid (by calling

method "solve").


The original solver was created with the following parameters:

executable: _glpk_direct

type: _glpk_direct

_args: ()

options: {}


Are python bindings working for CPLEX and GLPK??

Many thanks in advance,

Carlos

Watson, Jean-Paul

unread,
Sep 15, 2017, 10:50:07 AM9/15/17
to pyomo...@googlegroups.com

Direct python bindings are definitely working for cplex and gurobi. I am unsure about glpk, as I have no direct experience there. Hopefully someone else can chime in on that point.

 

That said, the error your are seeing is typically thrown if the python bindings are not correctly installed. You should first check to see if you can import the python bindings for GLPK from a python interactive session.

 

jpw

--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages