Ticket #4340 (closed defect: worksforme)

Opened 7 years ago

Last modified 5 years ago

glpsol called without arguments

Reported by: xypron.glpk@… Owned by: unassigned
Priority: normal Milestone: Coopr 3.5
Component: pyomo.opt Version:
Keywords: Cc: Amirhosein Norouzi <anorouz@…>

Description

Dear Sir or Madam,

running the following file

from coopr.pyomo import *
from coopr.opt import *
model = ConcreteModel?()
model.x_1 = Var(within=NonNegativeReals?)
model.x_2 = Var(within=NonNegativeReals?)
model.obj = Objective(expr=model.x_1 + 2*model.x_2)
model.con1 = Constraint(expr=3*model.x_1 + 4*model.x_2>= 1)
model.con2 = Constraint(expr=2*model.x_1 + 6*model.x_2>= 2)
instance = model.create()
instance.write("test")
opt = SolverFactory?("glpk")
results = opt.solve(instance)

results in error

File "test.py", line 14, in <module>

results = opt.solve(instance)

File "/usr/local/lib/python2.7/dist-packages/coopr.opt-2.7.1-py2.7.egg/coopr/opt/base/solvers.py", line 208, in solve

result = self._postsolve()

File "/usr/local/lib/python2.7/dist-packages/coopr.opt-2.7.1-py2.7.egg/coopr/opt/solver/shellcmd.py", line 162, in _postsolve

results = self.process_output(self._status.rc)

File "/usr/local/lib/python2.7/dist-packages/coopr.opt-2.7.1-py2.7.egg/coopr/opt/solver/shellcmd.py", line 203, in process_output

self.process_soln_file(results)

File "/usr/local/lib/python2.7/dist-packages/coopr.plugins-2.8-py2.7.egg/coopr/plugins/solvers/GLPK.py", line 330, in process_soln_file

raise ValueError?, msg % (glp_line_count, str(e))

ValueError?: Error parsing solution description file, line -- File not yet opened: [Errno 2] No such file or directory: '/tmp/tmpYgpuPN.glpk.glp'

The log file contains the following content

Solver command line: "/usr/local/bin/glpsol" --write /tmp/tmp6N4WMq.glpk.raw --wglp /tmp/tmpYgpuPN.glpk.glp --cpxlp /tmp/tmpBst7AN.pyomo.lp

GLPSOL: GLPK LP/MIP Solver, v4.47
No input problem file specified; try /usr/local/bin/glpsol --help

There seems to be a problem in
coopr.opt-2.7.1-py2.7.egg/coopr/opt/solver/shellcmd.py(183)_execute_command()

System used is
Python 2.7.2+
Linux family2 3.1.0-1-686-pae

Best regards

Xypron

Change History

comment:1 Changed 5 years ago by wehart

  • Status changed from new to closed
  • Resolution set to worksforme
  • Milestone set to Coopr 3.5

I tested this script on OS/X, and it works fine. I'm closing this, but please resubmit if this still is a problem.

Note: See TracTickets for help on using tickets.