Matplotlib library installation on GAMS

Dear ALL,
I am currently using GAMS_44.4, Linux version. And my OS is Ubuntu 20.04.6 LTS. I am solving a MINLP problem with DICOPT, and I would like to plot a graph for some time-dependent variables so that I could verify and compare my answer more directly. However, when I try to use the following command:

$onEmbeddedCode Python:

import matplotlib

matplotlib.use(‘WXAgg’)

import matplotlib.pyplot as plt

$offEmbeddedCode

The log file told me:


— Initialize embedded library libembpycclib64.so
— Execute embedded library libembpycclib64.so
File ,<‘string’>, line 3, in <‘module’>
Exception from Python (line 3): <class ‘ModuleNotFoundError’>: No module named ‘matplotlib’
*** Error executing embedded code section:
*** Error 865 in /home/username/Documents/GAMS/Studio/workspace/test.gms


I checked the forum topics, only one relates to this problem but it happens in Windows system. I would like to know what can I do for the same problem but in Linux system?

Thank you!

You can check this to learn how to attach your python to GAMS. Then, you can just run install matplotlib in a typical way with pip install matplotlib

Thank you so much sir! I will try to follow the guidance on the link you provided to see if I can apply it to my case! Have a nice day.