Trouble installing python API

Questions on using the GAMS APIs (Python, .NET, etc.)
Post Reply
T_k
User
User
Posts: 9
Joined: 1 year ago

Trouble installing python API

Post by T_k »

I installed the python API. but when I execute

Code: Select all

python3 transport1.py
, I get the following error.

Copy ASCII : trnsport.gms
Traceback (most recent call last):
File "/Library/Frameworks/GAMS.framework/Versions/45/Resources/apifiles/Python/transport1.py", line 24, in <module>
t1.run()
File "/Users/tanvirkaisar/opt/anaconda3/envs/test/lib/python3.10/site-packages/gams/control/execution.py", line 986, in run
tmp_cp, tmp_opt, pf_file_name, _ = self._prepare_run(
File "/Users/tanvirkaisar/opt/anaconda3/envs/test/lib/python3.10/site-packages/gams/control/execution.py", line 884, in _prepare_run
tmp_opt = GamsOptions(self._workspace, gams_options)
File "/Users/tanvirkaisar/opt/anaconda3/envs/test/lib/python3.10/site-packages/gams/control/options.py", line 2333, in __init__
raise gams.control.workspace.GamsException(ret[1])
gams.control.workspace.GamsException: Could not load shared library /Library/Frameworks/GAMS.framework/Versions/45/Resources/liboptdclib64.dylib: dlopen(/Library/Frameworks/GAMS.framework/Versions/45/Resources/liboptdclib64.dylib, 0x0002): tried: '/Library/Frameworks/GAMS.framework/Versions/4
zsh: segmentation fault python3 transport1.py

I checked that the library that is not being loaded exists in the directory
User avatar
Clemens
Posts: 67
Joined: 7 years ago

Re: Trouble installing python API

Post by Clemens »

Hi,

Chances are that the build architecture of your Python version and the GAMS installation do not match. There are notes on this in the documentation: https://www.gams.com/latest/docs/API_PY ... _APPLE_ARM
You might want to run both commands that are mentioned there in order to check if you are running compatible versions:

Code: Select all

gams audit

Code: Select all

python -c "import platform; print(platform.processor())"
Best,
Clemens
Post Reply