Pyomo/Eclipse/Gurobi Error

880 views
Skip to first unread message

stl...@gmail.com

unread,
May 10, 2016, 7:00:23 AM5/10/16
to Pyomo Forum
Hello,

I have a problem with Eclipse, Gurobi and Pyomo. I get the following error:


  File "C:\Anaconda3\lib\site.py", line 176

    file=sys.stderr)

        ^

SyntaxError: invalid syntax

ERROR: "[base]\site-packages\pyomo\opt\base\solvers.py", 570, solve
Solver (gurobi) returned non-zero return code (1)
ERROR: "[base]\site-packages\pyomo\opt\base\solvers.py", 573, solve
See the solver log above for diagnostic information.
Traceback (most recent call last):
  File "D:\Python\urbs_tree\runme.py", line 205, in <module>
    sce_number, current_sce_no)
  File "D:\Python\urbs_tree\runme.py", line 144, in run_scenario
    result = optim.solve(prob, tee=True)
  File "C:\Anaconda3\lib\site-packages\pyomo\opt\base\solvers.py", line 577, in solve
    "Solver (%s) did not exit normally" % self.name)
pyutilib.common._exceptions.ApplicationError: Solver (gurobi) did not exit normally



I use Windows 7 64bit and the following programms:
  • Gruobi 6.5.1 (Windows 64bit)
  • Anaconda 4.0.0 - Python 3.5.1 64bit
  • Pyomo 4.3.11328
  • Eclipse Mars 4.5.2
  • PyDev 5.0.0

Is there anyone with an idea what is wrong?

Thanks
Thomas

Gabriel Hackebeil

unread,
May 10, 2016, 6:09:32 PM5/10/16
to pyomo...@googlegroups.com
What command are you running when this happens? Also, if there is a Pyomo script you are executing, would you mind sharing it with me (off of the forum)?

Gabe

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

stl...@gmail.com

unread,
May 11, 2016, 2:18:37 AM5/11/16
to pyomo...@googlegroups.com
I use this commands:

    optim = SolverFactory('gurobi')
    optim = setup_solver(optim, logfile=log_filename)

    result = optim.solve(prob, tee=True) [At this line breaks]

The script which I use is open source and is located on Github  https://github.com/tum-ens/urbs. The problem is in the runme.py.

Gabriel Hackebeil

unread,
May 11, 2016, 2:52:05 AM5/11/16
to pyomo...@googlegroups.com
Is there any additional output from Gurobi that wasn’t included in your original email? It looks like setup_solver is adding a solver option that sets a logfile. Is there any helpful output in that file?

Gabe

On May 10, 2016, at 11:18 PM, stl...@gmail.com wrote:


optim = SolverFactory('gurobi')  # cplex, glpk, gurobi, ...
    optim = setup_solver(optim, logfile=log_filename)
    result = optim.solve(prob, tee=True)

stl...@gmail.com

unread,
May 11, 2016, 4:34:41 AM5/11/16
to Pyomo Forum
def setup_solver(optim, logfile='solver.log'):
    """ """
    if optim.name == 'gurobi':
        # reference with list of option names
        optim.set_options("logfile={}".format(logfile))
        # optim.set_options("timelimit=7200")  # seconds
        # optim.set_options("mipgap=5e-4")  # default = 1e-4
    elif optim.name == 'glpk':
        # reference with list of options
        # execute 'glpsol --help'
        optim.set_options("log={}".format(logfile))
        # optim.set_options("tmlim=7200")  # seconds
        # optim.set_options("mipgap=.0005")
    else:
        print("Warning from setup_solver: no options set for solver "
              "'{}'!".format(optim.name))
    return optim


There is unfortunatly no output file.


Thomas

Gabriel Hackebeil

unread,
May 11, 2016, 6:38:44 AM5/11/16
to pyomo...@googlegroups.com
It might be a Gurobi license issue. Can you launch the gurobi application (from the terminal or the desktop icon)?

Gabe

stl...@gmail.com

unread,
May 11, 2016, 11:23:26 AM5/11/16
to Pyomo Forum
I can launch gurobi from the terminal. I tryed it with a floating license and a single academic license... 

The script works when I start it with the terminal. (python runme.py)

leander...@gmail.com

unread,
Jul 31, 2016, 5:28:06 PM7/31/16
to Pyomo Forum
I have a simliar issue with pyomo - 4.3.11323 and Gurobi 6.0.4. When I run my program directly with a python interpreter, everything works fine. If I run it withina a taskmanager, I get the same ErrorMessage:
"Solver (gurobi) returned non-zero return code (1)" 
Did you have any solution for this issue?

Leander

David Woodruff

unread,
Jul 31, 2016, 6:39:07 PM7/31/16
to pyomo...@googlegroups.com
It still sounds like a license issue, but try looking at what gurobi is outputting by adding tee=true to your solve call. See:

https://software.sandia.gov/downloads/pub/pyomo/PyomoOnlineDocs.html#_display_of_solver_output
Reply all
Reply to author
Forward
0 new messages