Skip to main content

How To Install Academic License in Google Colab

Answered

Comments

8 comments

  • Gwyneth Butera
    Gurobi Staff Gurobi Staff

    As the message says, this license is not compatible with Docker containers. Please see the section "Web License Service for Container Environments Only" in Gurobi for Academics and Researchers for more information about requesting a license that can work within containers.

    1
  • Amany Akhyar
    Gurobi-versary
    First Comment
    First Question

    Thank you. It works :)

    0
  • David Islip
    Gurobi-versary
    First Comment

    Hello,

    I followed the instructions above oulined by Amany. I set up a license via "Web License Service for Container Environments Only" however, when I try to enter my API key I get the following message when trying to contact the license server

    Do I need to be connected to my academic institution for it to work? 

    Thank you,

    David

    0
  • Márton Zalavári
    Gurobi-versary
    First Comment

    Hello David,

    I was stuck on this for a day now as well.

    It turns out, you don't need to use the grbgetkey or any other licensing tool. You have to only specify the WLSACCESSID, WLSSECRET and LICENSEID in your Gurobi environment, as seen in this example: https://github.com/Gurobi/docker-python-example/blob/master/9.1.2/matrix1.py

    Hope, this works for you as well.

    1
  • David Islip
    Gurobi-versary
    First Comment

    Thank you Márton. It works now! 

    0
  • Alvaro Garcia Sanchez
    Gurobi-versary
    First Comment
    First Question

    Hello,

    I have tried to follow the instructions of this series of posts to use a docker licence I have obtained within the WLM. However, I cannot get the licence to work.

    Is there any detailed instructions that can be of help?

    Many thanks.

    Regards, 

    0
  • David Islip
    Gurobi-versary
    First Comment

    Hi Alvaro,

    I noticed this also. In addition to the WLM, I set up a local academic license and install it if the WLM fails. I store all the info in a CSV (gurobi.csv) with the following headers. 

    WLSACCESSID,LICENSEID,WLSSECRET,LOCAL
    

    and then run the following 

    #read in licence info from CSV as above
    gurobi_licence = pd.read_csv(pth +'RBSC/gurobi.csv')
    print("Required info for Gurobi:", gurobi_licence.columns)
    try:
      #web license: try to access it via university for first-time access. 
      e = gp.Env(empty=True)
      #e.setParam('OutputFlag', 0)
      e.setParam('WLSACCESSID', gurobi_licence.WLSACCESSID[0])
      e.setParam('LICENSEID', gurobi_licence.LICENSEID[0])
      e.setParam('WLSSECRET', gurobi_licence.WLSSECRET[0])
      e.start()
    except: 
      #location of grbgetkey
      !chmod 755 /content/gdrive/My\ Drive/Colab\ Notebooks/SVM\ MVO/gurobi/grbgetkey 
      #run grbgetkey with local license
      !/content/gdrive/My\ Drive/Colab\ Notebooks/SVM\ MVO/gurobi/grbgetkey {gurobi_licence.LOCAL[0]}
      e = gp.Env(empty=True)
      #chmod 755 grbgetkey
      e.start()
     
    Hope that helps,
     
    David
    0
  • Alvaro Garcia Sanchez
    Gurobi-versary
    First Comment
    First Question

    Thanks for your reply.

    I found this post in the Gurobi Support Portal and it really helped.

    Regards, 

    Álvaro.

    0

Please sign in to leave a comment.