PulpSolverError: PuLP: Error while trying to execute glpsol in Python 2.7 -


i'm running pulp on os x via ipython notebook , python 2.7. glpk installed using brew install homebrew/science/glpk , pulp installed via pip install pulp.

however i'm getting error in python:

--------------------------------------------------------------------------- pulpsolvererror                           traceback (most recent call last) <ipython-input-15-689fef0dd94f> in <module>()       1 # solve problem ----> 2 status = prob.solve(glpk(msg=0))       3   /users/x/anaconda/envs/data/lib/python2.7/site-packages/pulp/pulp.pyc in solve(self, solver, **kwargs)    1641         #time    1642         self.solutiontime = -clock() -> 1643         status = solver.actualsolve(self, **kwargs)    1644         self.solutiontime += clock()    1645         self.restoreobjective(wasnone, dummyvar)  /users/x/anaconda/envs/data/lib/python2.7/site-packages/pulp/solvers.pyc in actualsolve(self, lp)     364                              stderr = pipe)     365             if rc: --> 366                 raise pulpsolvererror("pulp: error while trying execute "+self.path)     367         else:     368             if os.name != 'nt':  pulpsolvererror: pulp: error while trying execute glpsol 

here's code triggers error:

from pulp import *  #variables x = lpvariable('x') y = lpvariable('y')  # problem prob = lpproblem('problem', lpminimize)  # constraints prob += x + y <= 1 prob += x <= 1 prob += -2 + y <= 4  # objective function minimize prob +=   # solve problem status = prob.solve(glpk(msg=0)) 

what's causing error, , how can fixed?

i had same error in ubuntu , solved it.

it necessary issue following command after make install:

sudo ldconfig

ldconfig creates necessary links , cache recent shared libraries.

https://lists.gnu.org/archive/html/help-glpk/2013-09/msg00018.html


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -