Problem using Ipopt solver with Pyomo in MacOS

1,448 views
Skip to first unread message

Manuel Soler Arnedo

unread,
May 25, 2015, 8:53:11 AM5/25/15
to pyomo...@googlegroups.com
Hello,

I'm trying to use IPOPT with Pyomo for solving an NLP problem. When creating the solver object with:

ipopt = SolverFactory('ipopt')


pyomo does not manage to find the ipopt executable, since repr(ipopt) gives the message:


<Plugin UnknownSolver 'ipopt'>

instead of the expected ASLplugin message. We have tried to link the executable to the same locations that we use succesfully on Linux ( /usr/local/bin ) but apparently Pyomo on Mac does not seem to look for it on the same location. Do you know which path should we use?


Many thanks in advance!!!

Carl Laird

unread,
May 25, 2015, 1:12:34 PM5/25/15
to pyomo...@googlegroups.com
Hi Manuel, Pyomo does not look in any particular place for the solver, it must be in your path. If you open a terminal and type ‘ipopt’, is it found?

Regards,

Carl D. Laird
Associate Professor, School of Chemical Engineering, Purdue University
Ph: 765.494.0085



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

Manuel Soler Arnedo

unread,
May 26, 2015, 10:26:09 AM5/26/15
to pyomo...@googlegroups.com
Thank you Carl,

Ipopt is in my path.
It works perfectly from any directory I'm working.

This is the message I get:

<Plugin UnknownSolver 'ipopt'>
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Applications/anaconda/lib/python2.7/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 682, in runfile
    execfile(filename, namespace)
  File "/Applications/anaconda/lib/python2.7/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 78, in execfile
    builtins.execfile(filename, *where)
  File "/Users/manuelsolerarnedo/Documents/My_Work/Python/pyomo_examples/example.py", line 129, in <module>
    results = ipopt.solve(m)
  File "/Applications/anaconda/lib/python2.7/site-packages/pyomo/opt/base/solvers.py", line 121, in solve
    self._solver_error('solve')
  File "/Applications/anaconda/lib/python2.7/site-packages/pyomo/opt/base/solvers.py", line 150, in _solver_error
    + "\n\t_options_str: %s" % ( self._options_str, ) )
RuntimeError: Attempting to use an unavailable solver.

The SolverFactory was unable to create the solver "ipopt"
and returned an UnknownSolver object.  This error is raised at the point
where the UnknownSolver object was used as if it were valid (by calling
method "solve").

To me it seems SolverFactory is not able to find Ipopt for some reason.
But Ipopt is for sure in the Path (I use it extensively with AMPL).

Any help is appreciated.
Thanks in advance.
Manuel.

David Woodruff

unread,
May 26, 2015, 12:08:53 PM5/26/15
to pyomo...@googlegroups.com
Hi Manuel,
  You seem to be running your script from within Spyder. That usually can be made to work, but if you are running from within spyder, you might try running from the bash prompt to see what happens. E.g.,
python myscript.py
  Dave

Manuel Soler Arnedo

unread,
May 27, 2015, 11:26:31 AM5/27/15
to pyomo...@googlegroups.com, dlwoo...@ucdavis.edu
Hello,

Yes, from the prompt works.
Thanks.

There is something wrong with Spider then.
Anyway, now I can keep going.
I'll try to figure out what is wrong with Spider later on.

Many Thanks!
MAnuel.
Reply all
Reply to author
Forward
0 new messages