Gurobi solver

How to use gurobi solver in GAMSpy with academic license?

You should install your license with:

gamspy install license <access_code>

Then, you should install gurobi for gamspy on your environment with:

gamspy install solver gurobi

Now, you can run your model with gurobi:

...
...
your_model
...
...

your_model.solve(solver="gurobi")

Thank you for your reply
However, when I applied this suggestion in the GAMSpy model, I still received an error message as

GamspyException: Solve status: LicenseError. The solver cannot find the appropriate license key needed to use a specific subsolver.

The Gurobi license works perfectly when I use gurobipy.

Make sure to set your environment variable “GRB_LICENSE_FILE”. Here is the related section in the Installation Docs.

Thank you…
I have followed the instructions provided in the link. However, I am still getting an error message:
GamspyException: Solve status: LicenseError. The solver cannot find the appropriate license key needed to use a specific subsolver.

What I have done is:
!pip install gamspy
!gamspy install license 5879d20c-aaa7-4cdf-9c92-c005b04a614f
!gamspy install solver gurobi
!export GRB_LICENSE_FILE=C:\Users\raalh\gurobi.lic
import gamspy as gpy
from gamspy import Container, Set, Parameter, Variable, Equation, Model, Sum, Sense, Options

Here is the full model:

When you run your notebook on Google Colab, it doesn’t run on your machine anymore. So, you cannot just give a path from your machine as the GRB_LICENSE_FILE. See https://neptune.ai/blog/google-colab-dealing-with-files to understand how you can upload files to Google Colab and use it in the notebook. In your case, you need the gurobi.lic file on Google Colab and set the path to the path in Google Colab machine.