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 228 forks source link

provide executable path docplex #87

Open Amin0G opened 1 year ago

Amin0G commented 1 year ago

Hi, I am using docplex.mp.model to create a mixed-integer programming model. Since I am using a cluster, I need to provide the path to binary executable to docplex so that docplex can recognize cplex. Is there a way to do that? Thanks.

PhilippeCouronne commented 1 year ago

Hello,

DOcplex does not need the cplex.exe executable, only the thin Python/C wrapper layer. This article explains the various options to setup the API: https://www.ibm.com/docs/en/icos/20.1.0?topic=cplex-setting-up-python-api

Personally, I would choose the PYTHONPATH option, because you have full explicit control of what happens. For example, on a Windows machine, assuming you have installed a Cplex Studio distribution in the directory, and run Python version 3.8 you need to add `

/python/3.8/x64_win64/` to your `PYTHONPATH` variable.