Skip to main content

Can not use GUROBI with CVXPY

Answered

Comments

9 comments

  • Official comment
    Simranjit Kaur
    Gurobi Staff Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi,

    Are you able to use Gurobi in Python. You can test it by trying to run one of our example files, e.g., \(\texttt{mip1.py}\) found in \(\texttt{<gurobiFolder>/examples/python}\).

    If the above does not work, please install the Gurobi Python interface as described here first.

     

    In case the Gurobi Python interface works properly, could you try running

    print(cvxpy.installed_solvers())in \(\texttt{CVXPY}\) and provide the output?

    Best regards,
    Jaromił

    0
  • Yongkang Zhou
    Gurobi-versary
    First Comment
    First Question

    Yes I can directly import gurobipy in python.

    The output of the code is

    ['ECOS', 'GUROBI', 'OSQP', 'SCS']
    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi,

    This problem seems to come from CVXPY and is related to this Github issue in the cvxpy Github. Could you try applying what is suggested by the CVXPY developers in their Github?

    Please let us know whether you were able to solve this issue.

    Best regards,
    Jaromił

    0
  • Yongkang Zhou
    Gurobi-versary
    First Comment
    First Question

    Yes, that solved my problem. Thank you so much for your help!

    0
  • Yufei Fu
    Gurobi-versary
    First Comment

    Hi, I also have the same problem and I followed the github site but still doesn't work.

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Could you post the exact error you are getting and the output of

    print(cvxpy.installed_solvers())

    and of

    your_application.INSTALLED_SOLVERS

    as in this Github issue in the cvxpy Github.

    Best regards,
    Jaromił

    0
  • Yufei Fu
    Gurobi-versary
    First Comment

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    This seems like a CVXPY issue. Did you try rebooting the jupyter notebook? Are you using the latest version of CXVPY?

    I would recommend posting your question in the CVXPY Github for better input.

    Best regards,
    Jaromił

    0

Post is closed for comments.