IBMDecisionOptimization / docplex-examples

These samples demonstrate how to use the DOcplex library to model and solve optimization problems.
https://ibmdecisionoptimization.github.io/
Apache License 2.0
396 stars 230 forks source link

CpoException: Executable file should be given in 'execfile' context attribute. #38

Closed Khaledjallouli closed 3 years ago

Khaledjallouli commented 3 years ago

Hello,

I wanted to run one of the examples on my laptop but I got an error in the following cell:

# Solve the model
print("\nSolving model....")
msol = mdl.solve(TimeLimit=20)

The error is: CpoException: Executable file should be given in 'execfile' context attribute.

Did anyone else had the same problem, please?

Thank you for your help.

vlkong commented 3 years ago

Hello, In order to solve constraint programming models, docplex needs the cpoptimizer executable (cpoptimizer.exe on Windows) to be in your PATH. This executable is in your /cpoptimizer/bin/x64_win64 directory if you are on windows (replace x64_win64 with your platform). Best regards,

Khaledjallouli commented 3 years ago

Thank you for the hint. Solved by pip install cplex