-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Environment variables persist after being unset #10392
Comments
@benjaminsirb Could you clarify your scenario here? Not exactly sure what you mean my unsetting them from the CLI. VS Code should be picking up the variables based on the kernel that you have selected. If you point out the variable in particular you could try grabbing the logs from the Jupyter section of the output window. Then save those logs to a file and attach it to a comment here. I believe that we logged env vars in that logging so maybe I can see what is happening here. |
@IanMatthewHuff Hello, I'm attaching the logs you asked for (please let me know if I misunderstood what you asked for). Also, attaching a screenshot that may help explain. Left window is jupyter lab, bottom right window is vscode, both running the same notebook / cell, same kernel. Also including my terminal output to illustrate that |
@benjaminsirb I believe that the issue here is that vscode doesn't pick up environmental variables from the terminal process that it was launched from. JupyterLab launches in the context of the terminal window where you have unset the Env Vars. But vscode won't have any knowledge of this unsetting. I has to work this way as VS Code can launch once and then start multiple different kernels from the same UI instance. But JupyterLab is just picking up the single terminal env that it's launched from. |
looks like this is related to #9682 |
I wanted to add to this issue as I feel its related. I have changed an environment variable and jupyter will not see the new value. It must be caching the value somewhere but cannot figure it out. I have restarted my mac and still doesn't work. Starting a terminal in VSCode, spawning python in terminal both see the new value but jupyter is seeing the old value. Please advise on any information i can give to help bug fix this |
@lukehuxham how are you setting the new env variable. Are you changing this env variable in your shell login script like |
@DonJayamanne I modified the variable in my .zshrc file. I have sourced the file as well as restarted the laptop multiple times. |
@lukehuxham Please could you
|
Should be fixed with #10843 |
@DonJayamanne do you have steps for how to verify this parituclar issue? |
Applies To
What happened?
Issue Type: Bug
I have unset environment variables through my CLI but vscode is still picking them up (through the os module in a jupyter notebook). When testing through jupyterlab, the variables do not exist. Same when trying to echo that var through vscode terminal (and native mac terminal).
Extension version: 2022.4.1021342353
VS Code version: Code 1.67.2 (Universal) (c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5, 2022-05-17T18:20:57.384Z)
OS version: Darwin arm64 21.5.0
Restricted Mode: No
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
A/B Experiments
VS Code Version
Version: 1.67.2 (Universal) Commit: c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5 Date: 2022-05-17T18:20:57.384Z (3 wks ago) Electron: 17.4.1 Chromium: 98.0.4758.141 Node.js: 16.13.0 V8: 9.8.177.13-electron.0 OS: Darwin arm64 21.5.0
Jupyter Extension Version
v2022.4.1021342353
Jupyter logs
No response
Coding Language and Runtime Version
python 3.8.11
Language Extension Version (if applicable)
No response
Anaconda Version (if applicable)
No response
Running Jupyter locally or remotely?
Local
The text was updated successfully, but these errors were encountered: