I have a pyomo model that I can solve using the GLPK solver by just using the code:
solver = pyo.SolverFactory('glpk')
solver.options['mipgap'] = 0.02
solution = solver.solve(model, tee=True)
Now I have installed the academic version of Gurobi on my computer. However I can't use Gurobi when having the code:
solver = pyo.SolverFactory('gurobi', solver_io="python")
solver.options['mipgap'] = 0.02
solution = solver.solve(model, tee=True)
I get the error message:
ApplicationError: No Python bindings available for <class 'pyomo.solvers.plugins.solvers.gurobi_direct.GurobiDirect'> solver plugin
Now I found this discussion on Stackoverflow Pyomo can't use Gurobi solver I did what the accepted answer advices. I used the windows cmd and navigated to my installation path of Gurobi. I tried two different folders
- C:\Gurobi\win64\
- C:\Gurobi\
and I use the suggested command
python setup.py install
However, I get an error message in the cmd of Windows telling that the command 'python' can't be found or is wrong. Do you know what I have to do in order to use Gurobi with Pyomo in Python?
py3 setup.py install
orpy -3 setup.py install
on Windows? $\endgroup$