The following methods can be used if you need to set an environment variable that will populate across your R session, VS code, Jupyter Notebook & JupyterLab Sessions.
You may specify environment variables to set when creating launcher sessions.
To specify environment overrides, modify the
/etc/rstudio/launcher-env file to consist of multiple environment entries separated by a blank line. see details here.
/etc/rstudio/launcher-env file is shown below.
In the example below, we'll configure a proxy environment variable using a Linux feature to apply it across all sessions.
1. Create a script in the
/etc/profile.d directory, for example:
chmod 755 /etc/profile.d/environment.sh
2. Modify the environment.sh to contain the environment variables you wish to set. Example
3. Once this is set, restart the services:
If the issue persists, feel free to open a support ticket here: https://support.posit.co/hc/en-us/requests/new