Decision Optimization

 View Only
  • 1.  Cplex python API in Jupyter

    Posted Mon August 17, 2020 03:52 AM
    I am trying to run cplex python example ( in Jupyter notebook. First I tried to import cplex in the Jupyter Notebook 
    from __future__ import print_function
    import sys
    from cplex.six.moves import range
    from inputdata import read_dat_file​
     I am getting this error below. 
    ModuleNotFoundError                       Traceback (most recent call last)
    <ipython-input-2-2446762ee40a> in <module>()
          5 import cplex
    ----> 6 from cplex.six.moves import range
          7 from inputdata import read_dat_file
    ModuleNotFoundError: No module named 'cplex.six​

    I tried to follow the instruction  below
    but my command prompt can't recognize the command  and getting this error
    C:\Program Files\IBM\ILOG\CPLEX_Studio129\cplex\python\3.7\x64_win64>Python install
    'Python' is not recognized as an internal or external command,
    operable program or batch file.​
    Any suggestion what is the best way to import cplex module to Jupyter notebook? 
    I am a cplex C++ API user. This settings is new to me. 

    Mohammad Roni


  • 2.  RE: Cplex python API in Jupyter

    Posted Mon August 17, 2020 04:01 AM
    This looks wrong to me:
    from cplex.six.moves import range​
    I think it should just read
    import cplex
    Then, if your system cannot find the python interpreter, you have to check your python installation. Make sure it is properly installed and the binary is on the PATH environment variable. Also maybe check the spelling. Maybe you have to specify as all lowercase.

    Daniel Junglas