Skip to content
Advertisement

Gams_magic does not work in Jupyter notebook and returns ModuleNotFoundError

I just wanted to use gams inside Jupyter notebook in order to use data frames of pandas in gams codes.

I followed the instructions of this page to get started with the gams in Jupyter. However, I can not call gams and when I run this line

JavaScript

I get the following error:

JavaScript

I really do not know where is the problem. Moreover, there is not any source to address this issue.

Advertisement

Answer

It looks like the gams_magic package can not be found. The installation procedure for the GAMS Python API requires the environment variable SETUPTOOLS_USE_DISTUTILS to be set to stdlib in case the Python installation uses setuptools>=60.0.0. In order to check this you can run:

JavaScript

If this is the case, you can run the following command before running python setup.py install:

JavaScript

See also the latest documentation for installing the GAMS Python API here: https://www.gams.com/latest/docs/API_PY_TUTORIAL.html#PY_COPY_GAMS_FILES_TO_PYTHON_INSTALLATION

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement