0

I am using Pulp with Python 3.8 and Spyder 4.

I am able to run optimization problems without issues, but I am not able to change the parameters of the solvers. Indeed, no solver seems to be recognized by Pulp.

When I enter

my_lp_problem.solve(PULP_CBC_CMD())

I have the error :

name 'PULP_CBC_CMD' is not defined

How can I manage this problem?

Thank you!

1

1 Answer 1

0

If you get a NameError (i.e., name 'PULP_CBC_CMD' is not defined) it's because you have not imported the pulp.PULP_CBC_CMD class.

The solution is either to import it

from pulp import PULP_CBC_CMD

or to specify the pulp module

my_lp_problem.solve(pulp.PULP_CBC_CMD())

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.