I have a Docker machine running Linux. I am using Pyomo with the GLPK solver. I installed GLPK from the shell command line for the Docker image, using apt-get install glpk-utils
I have all my code saved under the subfolder /code
I can see glpsol
is installed under path: /usr/bin
I can see that /usr/bin
is a path under the PATH environment variable.
I have the relevant imports as follows:
from pyomo.environ import *
from pyomo.opt import SolverFactory
When I run opt = SolverFactory("glpk")
, I get the following error:
Attempting to use an unavailable solver.
The SolverFactory was unable to create the solver "glpk"
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").
The original solver was created with the following parameters:
type: glpk
_args: ()
options: {}
I am not sure if this is Docker-related or if I should have used a different package for apt-get
.
I have used all the most recent versions of everything.
Would really appreciate any help with this.