# KNITRO license path

**URL:** https://discourse.julialang.org/t/knitro-license-path/130145
**Category:** Optimization (Mathematical)
**Tags:** vscode, environment-variable, knitro
**Created:** [June 23, 2025, 11:03pm UTC](https://discourse.julialang.org/t/knitro-license-path/130145 "2025-06-23T23:03:43Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![CeterisPartybus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ceterispartybus/32/46868_2.png) [@CeterisPartybus](https://discourse.julialang.org/u/CeterisPartybus)
#### Post date: [June 23, 2025, 11:03pm UTC](https://discourse.julialang.org/t/knitro-license-path/130145/1 "2025-06-23T23:03:43Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)
#### Post date: [June 24, 2025, 7:29am UTC](https://discourse.julialang.org/t/knitro-license-path/130145/2 "2025-06-24T07:29:42Z")

</div>

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:

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

```

---

<div class="post-metadata">

### Author: ![digital\_carver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/digital_carver/32/33818_2.png) [@digital\_carver](https://discourse.julialang.org/u/digital_carver)
#### Post date: [June 24, 2025, 1:25pm UTC](https://discourse.julialang.org/t/knitro-license-path/130145/3 "2025-06-24T13:25:14Z")

</div>

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

 ![image](https://global.discourse-cdn.com/julialang/original/3X/0/a/0a90a33094c052c4cf69201bedc8bd0b92d5375b.png)

---

<div class="post-metadata">

### Author: ![CeterisPartybus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ceterispartybus/32/46868_2.png) [@CeterisPartybus](https://discourse.julialang.org/u/CeterisPartybus)
#### Post date: [June 24, 2025, 6:21pm UTC](https://discourse.julialang.org/t/knitro-license-path/130145/4 "2025-06-24T18:21:19Z")

</div>

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"]`

---

<div class="post-metadata">

### Author: ![CeterisPartybus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ceterispartybus/32/46868_2.png) [@CeterisPartybus](https://discourse.julialang.org/u/CeterisPartybus)
#### Post date: [June 24, 2025, 6:42pm UTC](https://discourse.julialang.org/t/knitro-license-path/130145/5 "2025-06-24T18:42:53Z")

</div>

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.
