Here is what I tried:
Setup venv and install jupyter lab
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install jupyterlab
export FOO="bar"
run Jupyter Lab:
./venv/bin/jupyter lab
inside the notebook:
import os
print(os.getenv("FOO"))
returns: bar
perfect.
Now, I want to add another env var. So in another terminal:
source venv/bin/activate
export FOOX="bar"
and
import os
print(os.getenv("FOOX"))
returns None
Why?
I tried restarting the kernel.
I tried restarting jupyter lab.
There must be something I don’t understand about env vars. Using another terminal may be the issue?