1

I'm trying to use GAMS in Julia for an optimization problem. I already installed GAMS and was able to use GAMS with python successfully in VScode. However, I kept getting "GAMS executable not found" in Julia. I'm using an M1 chip MacBook.

So in Terminal (Rossetta - as I'm using older GAMS version), I already installed GAMS:

using Pkg
Pkg.add("GAMS")

Then, I use GAMS' CPLEX as optimizer for my model:

using GAMS, JuMP
model = Model(GAMS.Optimizer)
set_optimizer_attribute(model, "Solver", "CPLEX")
set_optimizer_attribute(model, GAMS.Solver(), "CPLEX")

Here, I checked to see if the GAMS systems directory has been added to PATH and it is not, since:

print(ENV["PATH"])

gives me

/usr/bin:/bin:/usr/sbin:/sbin

However, when I run this code in terminal, the GAMS systems directory is already added in PATH:

/Library/Frameworks/GAMS.framework/Versions/34/Resources:/usr/local/bin:/usr/local/sbin:/Users/<name>/.pyenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/Applications/FICO Xpress/Xpress Workbench.app/Contents/Resources/xpressmp/bin:/Applications/Julia-1.9.app/Contents/Resources/julia/bin/:/Users/<name>/anaconda3/bin:/Users/<name>/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Why is that? And how do I make Vscode recognize my PATH above for my Julia code?

user496181
  • 141
  • 7
  • Does adding `"terminal.integrated.env.osx": { "PATH": "/Library/Frameworks/GAMS.framework/Versions/34/Resources:${env:PATH}" ` to your `settings.json` in VS Code help? – Sundar R Aug 05 '23 at 16:43
  • See also: https://stackoverflow.com/questions/43983718/how-can-i-globally-set-the-path-environment-variable-in-vs-code – Przemyslaw Szufel Aug 05 '23 at 19:04
  • @PrzemyslawSzufel I tried this and my path was still not recognized. I tried what SundarR suggested and that seems to be the solution in this case. Thank you very much! – user496181 Aug 07 '23 at 19:45

0 Answers0