ERROR: Solver log: Unrecognized flag or missing argument: -AMPL

20 views
Skip to first unread message

dol...@oliversystems.net

unread,
May 23, 2018, 2:29:18 PM5/23/18
to Pyomo Forum
I am trying to use gurobi 8.0 with pyomo 5.5. When solving a simple model as a test I get the following error: ERROR: Solver log: Unrecognized flag or missing argument: -AMPL


from pyomo.environ import *


model
= ConcreteModel()


model
.x = Var([1,2], domain=NonNegativeReals)


model
.OBJ = Objective(expr = 2*model.x[1] + 3*model.x[2])


model
.Constraint1 = Constraint(expr = 3*model.x[1] + 4*model.x[2] >= 1)


solver
= SolverFactory("gurobi_cl")


results
= solver.solve(model)  #error here


model
.solutions.store_to(results)


print(results)




Siirola, John D

unread,
May 23, 2018, 4:19:43 PM5/23/18
to pyomo...@googlegroups.com

You should create the solver with:

 

                solver = SolverFactory(“gurobi”)

 

john

--
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.

David Oliver

unread,
May 23, 2018, 4:54:51 PM5/23/18
to pyomo...@googlegroups.com
I just installed gurobi (v8.0) and there Ido not see gurobi.exe file in the package.  There is a gurobi_cl.exe.  Using  solver = SolverFactory(“gurobi”) throws this error:

   WARNING: Could not locate the 'gurobi' executable, which is required for solver gurobi


To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum+unsubscribe@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
David Oliver
Oliver Systems, LLC
366 6th Street, #2
Brooklyn, NY  11215

Bynum, Michael Lee

unread,
May 23, 2018, 4:55:54 PM5/23/18
to pyomo...@googlegroups.com
How did you install gurobi?

Michael

To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.

David Oliver

unread,
May 23, 2018, 4:59:11 PM5/23/18
to pyomo...@googlegroups.com
via Anaconda

Bynum, Michael Lee

unread,
May 23, 2018, 5:14:29 PM5/23/18
to pyomo...@googlegroups.com
I think Pyomo uses gurobi.sh by default. I have seen an issue before where installing gurobi with conda somehow leaves out gurobi.sh, but importing gurobipy within the active python works fine. Can you briefly try 

Solver = SolverFactory(‘gurobi_direct’)

Michael

To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.

David Oliver

unread,
May 24, 2018, 10:06:18 AM5/24/18
to pyomo...@googlegroups.com
Will do and then report.

David Oliver

unread,
May 29, 2018, 11:20:15 AM5/29/18
to pyomo...@googlegroups.com
Michael,

Using  gurobi_direct’works!  Am I getting the full feature set of gurobi with that call, or should I work on my installation until I can get  Solver = SolverFactory(‘gurobi’) working.  Also, do you have any recommendations for documentation/tutorials/sample code that a newcomer should know about?

Thanks,

Davied
Reply all
Reply to author
Forward
0 new messages