Search code examples
pythonlinuxcplexpyomowebsphere

Python ibm pyomo cplex


I need some help with the activation of cplex community edition on linux in combination with python/pyomo. I have followed the installation procedure on https://www.ibm.com/support/pages/node/297247

I have written the following two lines into my bash_profile

export CPLEX_STUDIO_DIR1210=/path/to/cplex

export CPLEX_API_KEY=...

Then I have restarted my machine but I always get the message "Cplex Error 1016: Community Edition. Problem size limits exceeded."

I also have tried to write the export lines into bashrc but without success.

My relevant python code line looks like: Optimize = SolverFactory ('cplex', executable='/path/to/cplex-executable')

I am looking forward to any hints. Thx


Solution

  • To unlock the model size limitations you need to set the CPLEX_STUDIO_KEY environment variable, not CPLEX_API_KEY. If you fix that, hopefully your issue should go away.

    EDIT:

    I didn't notice it the first time, but as far as I know, the CPLEX Community Edition is only available for 12.9 at this time. Please try setting the CPLEX_STUDIO_DIR129 environment variable instead of CPLEX_STUDIO_DIR1210. For example:

    export CPLEX_STUDIO_DIR129=/path/to/cplex