Solver Connection

Python has to know where to find your solver to be able to use it. Here are operating system dependent instructions for how to make that happen:

Mac

  • Use a text editor to open ~/.bash_profile

  • Add your solver’s \bin directory to the path, e.g.:

    export PATH=$PATH:/Library/gurobi452/mac64/bin/

Windows

Linux

  • Use a text editor to open ~/.bashrc

  • Add your solver’s \bin directory to the path, e.g.:

    export PATH=$PATH:/opt/gurobi452/linux64/bin/

Testing

  1. Check that you set your solver-to-Python connection correctly (by the instructions above)
  2. Call the solvers from the command line. After following the solver-to-Python directions above CPLEX should be called by cplex, GLPK by glpsol, Gurobi by gurobi. If this doesn’t work check your Path variable and reopen the command prompt.
  3. If you are still having trouble, make sure your solver is installed correctly (and exactly where you think it should be), or consider trying a different solver first.

Project Versions

Table Of Contents

This Page