I am a newbie with python and optimization. I am getting some error, please help me resolve it. I tried running the below mentioned code in PyCharm where I am running Anaconda 3
from pulp import *
x = LpVariable("x", 0, 3)
y = LpVariable("y", 0, 1)
prob = LpProblem("myProblem", LpMinimize)
prob += x + y <= 2
prob += -4*x + y
status = prob.solve(GLPK(msg = 0))
value(x)
And I got an error
Traceback (most recent call last): File "D:/Projects/RH Analytics/RNN/TestPulp.py", line 10, in status = prob.solve(GLPK(msg = 0)) File "C:\Users\rahul.bajaj\AppData\Local\Continuum\Anaconda3\lib\site-packages\pulp\pulp.py", line 1643, in solve status = solver.actualSolve(self, **kwargs) File "C:\Users\rahul.bajaj\AppData\Local\Continuum\Anaconda3\lib\site-packages\pulp\solvers.py", line 346, in actualSolve raise PulpSolverError("PuLP: cannot execute "+self.path) pulp.solvers.PulpSolverError: PuLP: cannot execute glpsol.exe
Process finished with exit code 1
So I downloaded the glpk package from here, extracted from the zip file and placed it in a folder in C drive. In the path variable I added "C:\winglpk-4.57\glpk-4.57\w64".
But even now I am getting the same error when i run the program in the PyCharm IDE. Please help me sort out what am I missing.