0
votes

I install Baron solver on windows and I use pyomo in Spyder. I move baron.exe to current directory when I run my code, this error appears:

Solver log file: 'C:\Users\~\AppData\Local\Temp\tmpumg5hxvr.baron.log'
Solver solution file: 'C:\Users\~\AppData\Local\Temp\tmpbmx1pfpt.baron.soln'
Solver problem files: ('C:\\Users\\~\\AppData\\Local\\Temp\\tmpygo80gcy.pyomo.bar',)
C:\Users\~\baron.exe: can't open C:\Users\~\AppData\Local\Temp\tmpygo80gcy.pyomo.bar.nl
ERROR: Solver (baron) returned non-zero return code (1)
ERROR: See the solver log above for diagnostic information.
Traceback 
ApplicationError: Solver (baron) did not exit normally

But There is not the log file: C:\Users\~\AppData\Local\Temp\tmpumg5hxvr.baron.log How can I fix this problem? Thanks for your helps in advance.

1
Try adding the tee=True option to your solve statement in order to see some more information about the solver’s actions. - gmavrom
@gmavrom I had added it. My code was: opt.solve(instance,keepfiles=True,tee=True) - hamta
This might have something to do with Pyomo misidentifying the executable as an ASL solver. What does your invocation of SolverFactory look like? - Qi Chen
@QiChen Thanks for your reply. My invocation is like this: from pyomo.opt import SolverFactory opt = SolverFactory('baron') opt.solve(instance,keepfiles=True,tee=True) - hamta
try opt=SolverFactory('baron', solver_io='bar') or opt=SolverFactory('baron', executable='C:\\Users\\~\\baron.exe') - Qi Chen

1 Answers

0
votes

I met the same problem today. I solved the problem by changing the solver name 'baron' to 'Baron'