I'm trying to run my model through python. I installed the python API and the transport1.py model works. If I however change the ws.add_job_from_file("trnsport.gms") to my model file it gives me a gams return code (2). If I open my sankey.gms file directly through the gams gui then everything works correctly. What am I doing wrong?
Thanks!
Code: Select all
from __future__ import print_function
from gams import *
import os
import sys
version = GamsWorkspace.api_version
sysdir = "c:\\GAMS\\win64\\" + version[0:4]
if __name__ == "__main__":
# if len(sys.argv) > 1:
# ws = GamsWorkspace(system_directory = sys.argv[1])
# else:
ws = GamsWorkspace(system_directory =sysdir)
t1 = ws.add_job_from_file("C:\\GAMS\\win64\\24.9\\TEST\\sankey.gms")
opt = ws.add_options()
opt.all_model_types = "cplex"
t1.run(opt)
print("Ran with cplex:")