# Problems Installing APOPT in Pyomo

I am trying to install the solver "APOPT" in Pyomo by following the guidelines laid out below:

*Instructions for usage:

1. Place apopt.py in an appropriate folder in the system path (e.g. Linux, /usr/bin/)
2. Set appropriate permissions to make the script executable (e.g. chmod 775 apopt.py)
3. In AMPL, Pyomo, or other NL file write, set solver option to apopt.py
4. Test installation by running apopt.py -test *

I essentially copy/paste the apopt.py script from the GitHub Repository into a .py file and have placed it in my project folder that I am working in. I think that the permissions should be okay. However, when I run step 3 at the command line I get the following errors:

WARNING: Failed to create solver with name 'apopt': Failed to set executable for solver asl. File with name=apopt either does not exist or it is not executable. To skip this validation, call set_executable with validate=False.

And when I try to do Step 4 I get:

'apopt' is not recognized as an internal or external command, operable program or batch file.

I am not sure why this is happening though?

From your description, I suspect that the solver's name should be --solver=apopt.py instead of --solver=apopt.
• On Linux this is valid Pyomo syntax, but on Windows you need a .exe file for Pyomo. If APOPT has an .exe, try --solver=apopt.exe. If not, you can convert the .py file to an executable (e.g. using py2exe). Another thing you can try is to make sure that the apopt binary is in your administrator user's PATH variable. Sep 3 '19 at 18:27