Search code examples
pythoncplex

CPLEX and Python 3.7


I'm trying to use cplex with python version 3.7.3. CPLEX has a setup.py for version 3.7, but when I try to use it I still get the error "CPLEX 12.9.0.0 is not compatible with this version of Python". Is there a workaround for this or do I need to downgrade to Python 3.6?


Solution

  • Let's assume the Python 3.7 executable is located at C:\Python37\python.exe and CPLEX 12.9 is installed at C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129. Then, to install the CPLEX Python API, you would do something like the following:

    cd "C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\python\3.7\x64_win64\"
    C:\Python37\python.exe setup.py install
    

    The installation instructions for the CPLEX Python API can be found here.