0
votes

I am using Baron solver with a licence version under AMPL licence for solving a MINLP in Pyomo and Spyder. I use baron in my code as following:

opt=SolverFactory('baron', executable='/home/LocalUser/ampl_linux-intel64/baron')
result=opt.solve(instance, keepfiles=True,tee=True)

but when I run my code, I got this error:

Solver log file: '/tmp/tmpil8__em2.baron.log'
Solver solution file: '/tmp/tmpvphbmoa8.baron.soln'
Solver problem files: ('/tmp/tmpl7sk5uym.pyomo.bar',)
/home/LocalUser/ampl_linux-intel64/baron: can't open /tmp/tmpl7sk5uym.pyomo.bar.nl
ERROR: Solver (baron) returned non-zero return code (1)
ERROR: See the solver log above for diagnostic information.
Traceback (most recent call last):
  File "Platform-nonlinear.py", line 236, in <module>
    result=opt.solve(instance, keepfiles=True,tee=True)
  File "/home/LocalUser/.local/lib/python3.6/site-packages/pyomo/opt/base/solvers.py", line 596, in solve
    "Solver (%s) did not exit normally" % self.name)
pyutilib.common._exceptions.ApplicationError: Solver (baron) did not exit normally

I tried it in both windows and linux but I got the same error at both time!!! T really don't know how I can fix it!

1

1 Answers

0
votes

What I can suggest you is that to try to relocate your temp dir to a location where you have full access to it. Commonly, and in my case "macos", restricts access to TMPDIR only to system so probably your files can't be stored on that location and then can't be retrieved.

My TMPDIR Access

"printenv |grep TMP" or "echo $TMPDIR" will show you your TEMP folder\'s address

If that is the case you can find how to change the TMPDIR of your OS by a simple search.