Installation and Licensing#

Basic Installation#

You can run the following command to install GAMSPy from PyPI:

pip install gamspy

Building from source#

If you are a MacOS or Linux user (or using a subsystem like WSL in Windows) who is familiar with using the command line, you can continue with building GAMSPy locally by following the instructions below.

Prerequisites#

Building GAMSPy requires the following software installed:

  1. Python 3.8.x or newer

  2. The GAMSPy source code:

    git clone git@github.com:GAMS-dev/gamspy.git
    

Installation#

You can install GAMSPy from source with the following command:

pip install .

Licensing#

GAMSPy comes with a free demo license which lets you generate and solve small models. For more information about GAMS licenses and how to get a new license, check GAMS Licensing.

Installing or updating your license#

A GAMSPy license is a either an ASCII file of six lines or 36 character identification number which is sent to you via e-mail. In order to install your license, all you need to do is to run:

gamspy install license <path_to_ascii_file or identification number>

For machines that are not connected to the internet, to install a license with the information of the node, one can run:

gamspy install license -i <your_license_number>

This option is only available for licenses in identification number format.

Uninstalling your license#

If you don’t want to use your own license, you can uninstall your license with the following command:

gamspy uninstall license

Solvers#

GAMSPy comes with default solvers and more solvers can be installed on demand.

Listing Solvers#

In order to list the installed solvers on your machine, you can run either:

gamspy list solvers

or if you want to list all available solvers, you can run the following:

gamspy list solvers --all

The same information can also be reached programmatically via utils module of GAMSPy:

import gamspy as gp
print(gp.utils.getInstalledSolvers())
print(gp.utils.getAvailableSolvers())

Note

All available solver packages can also be found on PyPI.

Installing/Uninstalling New Solvers#

The following command is available for installating new solvers:

gamspy install solver <solver_name>

Similarly, a solver can be uninstalled with:

gamspy uninstall solver <solver_name>

Updating Solvers#

If the solvers in your machine are not up-to-date, you can run:

gamspy update

To update all solvers to a version that is compatible with GAMSPy.

Testing#

Tests are classified into three: unit tests, integration tests and doc tests. The tests can be run with:

python tests/test_gamspy.py

Note

By default, only unit tests are running. To enable integration tests, –integration argument should be provided. Doctests can be enable with –doc argument.