spopt: pulp.apis.core.PulpSolverError: Pulp: cannot execute cbc.exe

Hello,

I am trying to execute the following:

solver = pulp.COIN_CMD(msg=True, warmStart=True)

pcenter_from_cm = PCenter.from_cost_matrix(
    distances, p_facilities=facilities, name="p-center-network-distance"
)

pcenter_from_cm = pcenter_from_cm.solve(solver)

But get the following error:

pcenter_from_cm = pcenter_from_cm.solve(solver)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\x\Documents\spopt_venv\lib\site-packages\spopt\locate\p_center.py", line 409, in solve
    self.problem.solve(solver)
  File "C:\Users\x\Documents\spopt_venv\lib\site-packages\pulp\pulp.py", line 1913, in solve
    status = solver.actualSolve(self, **kwargs)
  File "C:\Users\x\Documents\spopt_venv\lib\site-packages\pulp\apis\coin_api.py", line 137, in actualSolve
    return self.solve_CBC(lp, **kwargs)
  File "C:\Users\x\Documents\spopt_venv\lib\site-packages\pulp\apis\coin_api.py", line 146, in solve_CBC
    raise PulpSolverError(
pulp.apis.core.PulpSolverError: Pulp: cannot execute cbc.exe cwd: C:\Users\x\Documents\

Does anybody have any suggestions?

I have tried passing the msg=1 argument to the solver, to get more information.

I have checked the precision of the numbers, rounding them.

The cost distance matrix is is a pairwise distance matrix of one df of points - i.e. with itself. Could it be that it is due to duplicated variables / constraints?

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Hey there! Installing pulp via pip/conda does not install COIN_CMD. To use this solver, you should have CBC installed in your environment. See the instruction here.

If this error persists, please let us know.

By the way, the pip install pulp installs automatically PULP_CBC_CMD so you can use that instead COIN_CMD.