Installation and Licensing#
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.
Building GAMSPy requires the following software installed:
Python 3.8.x or newer
The GAMSPy source code:
git clone email@example.com:GAMS-dev/gamspy.git
You can install GAMSPy from source with the following command:
pip install .
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 GAMS license file is an ASCII file of six lines, which is sent to you via e-mail. Please copy all six lines into a file (typically named gamslice.txt). Then, run:
gamspy install license <path_to_your_license_file>
GAMSPy comes with 6 default solvers (CPLEX, CONOPT, PATH, NLPEC, SBB, and CONVERT) and more solvers can be installed on demand.
In order to list the installed solvers, 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
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>
If the solvers in your machine are not up-to-date, you can run:
To update all solvers to a version that is compatible with GAMSPy.
Tests are classified into three: unit tests, integration tests and doc tests. The tests can be run with:
By default, only unit tests are running. To enable integration tests, –integration argument should be provided. Doctests can be enable with –doc argument.