Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  cplex 12.5, python

    Posted 07/18/13 11:00 AM

    Originally posted by: Goo.Gle


    hello all,

    with which version of python can I use cplex 12.5? does it work with python 3.2?

     

    regards, gle


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: cplex 12.5, python

    Posted 08/06/13 12:28 PM

    Originally posted by: Laci Ladanyi


    Hi gle,

    Unfortunately the python interface in the current release of cplex does not work with python 3.2, it works only with the 2.x series.

    --Laci


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: cplex 12.5, python

    Posted 04/18/14 04:35 PM

    Originally posted by: pratras


    Hey,

    I have CPLEX 12.6 64 bit windows version. Which version of python is compatible? Can i use 64 bit python?

     

    Thanks,

    Prateek


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: cplex 12.5, python

    Posted 04/18/14 04:56 PM

    Python 2.7.x is supported with 12.6 (the only exception is on Linux where we also support Python 2.6.x).  You'll want the 64-bit version of Python to go with your 64-bit CPLEX installation.  See the Setting up the Python API of CPLEX page for installation instructions.

    EDIT: The link in my original post was bad.  Hopefully it's fixed now.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: cplex 12.5, python

    Posted 04/18/14 05:25 PM

    Originally posted by: pratras


    Thanks!

    I am using Python 2.7.6 64 bit version. I am getting following error while trying to import cplex module:

     

    Traceback (most recent call last):
      File "C:\Users\Prateek\workspace\CplexTest\CTest.py", line 35, in <module>
        import cplex
      File "C:\Program Files\IBM\ILOG\CPLEX_Studio126\cplex\python\x64_win64\cplex\__init__.py", line 957
        except exceptions.CplexSolverError, exc:
                                          ^
    SyntaxError: invalid syntax

    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: cplex 12.5, python

    Posted 04/18/14 06:50 PM

    I get the same error if I try to run using python3.  Try again using the full path to python27 instead.  For example:

    > c:\Python27\python.exe

    ...

    >>> import cplex

    If this runs without exceptions, then you should be good to go.  Just make sure you run the correct python executable.


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: cplex 12.5, python

    Posted 04/21/14 10:36 AM

    Originally posted by: pratras


    Thanks Ryan! now it is running perfectly. 


    #CPLEXOptimizers
    #DecisionOptimization