I wanted to solve my Oprimization model in Python by Cplex so I installed Cplex in my system (Windows 11) and based on Cplex help insttall setup.py with this command: python C:\Program Files\IBM\ILOG\CPLEX_Studio221\python\setup.py install
There are two examples in IBM "Docplex.cp" and "Docplex.mp". I run these exampleas using the vscode and jupyter. All exampleas of "Docplex.cp" run correctly but when I run examples of "Docplex.mp" I see Cplex runtime error.
This is one simple linear model that I have tried:
# Define the Model
from docplex.mp.model import Model
MWMS_model=Model(name="Linear Program")
# Variables
x=MWMS_model.continuous_var(name='x', lb=0)
y=MWMS_model.continuous_var(name='y', lb=0)
# Constraints
c1=MWMS_model.add_constraint(x+y>=8,ctname="c1")
c2=MWMS_model.add_constraint(2*x+y>=10,ctname="c2")
c3=MWMS_model.add_constraint(x+4*y>=11,ctname="c3")
# Objective Function
obj=5*x+4*y
MWMS_model.set_objective('min', obj)
MWMS_model.print_information()
# Solvig
MWMS_model.solve()
# Output
MWMS_model.print_solution()
This is the error: "docplex.mp.utils.DOcplexException: Cannot solve model: no CPLEX runtime found."