CPLEX error: list index out of range

312 views
Skip to first unread message

Niko Sido

unread,
Feb 25, 2021, 12:49:51 PM2/25/21
to Pyomo Forum
Latest CPLEX studio 20.1 (CPLEX 12.9)release seem to have a problem with running as a default PyOMO solver. A model example:

import pyomo.environ as pyo
model = pyo.ConcreteModel()
model.x = pyo.Var([1,2], domain=pyo.NonNegativeReals)
model.OBJ = pyo.Objective(expr = 2*model.x[1] + 3*model.x[2])
model.Constraint1 = pyo.Constraint(expr = 3*model.x[1] + 4*model.x[2] >= 1)
instance = model.create_instance()
opt = pyo.SolverFactory('cplex')
opt.solve(instance) 


PyOMO complains complains:
 objective_value = (tokens[0].split('=')[1].strip()).lstrip("\"").rstrip("\"")
IndexError: list index out of range 

Has anyone saw something similar and found a fix?

Siirola, John D

unread,
Feb 25, 2021, 1:36:46 PM2/25/21
to pyomo...@googlegroups.com

Which version of Pyomo are you using?  I believe that 12.9 compatibility was resolved in Pyomo 5.7.3.

 

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyomo-forum/6ac0a8b3-2bf4-46a7-83f8-c594b0dfa445n%40googlegroups.com.

Niko Sido

unread,
Feb 25, 2021, 5:49:50 PM2/25/21
to Pyomo Forum
It solved it -
Thank you!

Saber Talari

unread,
Mar 9, 2021, 8:57:03 AM3/9/21
to Pyomo Forum
I have faced the same problem. How did you fix it?

Thanks -
Saber

Niko Sido

unread,
Mar 9, 2021, 9:26:15 AM3/9/21
to pyomo...@googlegroups.com
Just updating PyOMO to the latest release fixed the problem for CPLEX 12.9; you at have CPLEX 12.10 though 

Sent from my iPhone

On Mar 9, 2021, at 7:57 AM, Saber Talari <saber....@gmail.com> wrote:

I have faced the same problem. How did you fix it?
You received this message because you are subscribed to a topic in the Google Groups "Pyomo Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyomo-forum/gCemf7qgrDA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyomo-forum...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyomo-forum/db5161c0-ed04-4a5c-9788-2994cb30dbebn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages