KNITRO license path

From where does Julia in VS Code source environmental variables setting the KNITRO license path ENV[“ARTELYS_LICENSE”]?

The issue:
I updated my KNITRO license file and its location and set the environment variable in .zsh_rc and .bash_profile to the new license location with
export ARTELYS_LICENSE=<path to license file>.

Starting Julia in a Mac-Terminal and calling Knitro works without issues. When calling Julia from a zsh or bash terminal within VS Code everything works as expected.

However, when opening a REPL in VS Code, KNITRO cannot find the license file. Investigating the ARTELYS_LICENSE environmental variable shows that it still has the path to the old license file stored.

Do you have any idea why only the REPL in VS Code still has the old path stored?

Thanks a lot!

I’m not sure, but I assume VS Code starts with a clean environment.

A simple answer is to set the variable directly in code:

ENV["ARTELYS_LICENSE"] = "/path/to/lic"
using KNITRO

You have to explicitly ask VS Code (or Codium) to inherit the environment variables by setting inheritEnv to true:

Thanks. That works but I hoped I could get a solution with which I do not have to set the path every time. It worked before and weirdly enough still stores the old path and license file name in ENV["ARTELYS_LICENSE"]

Thanks! That works on my laptop but I am trying to get it running on a server. The option does not seem to be available when connecting via SSH.