In SageMaker notebook instances, you should set environment variables using the conda activate/deactivate hook scripts inside the lifecycle configuration. Place all your exports in /home/ec2-user/anaconda3/envs/python3/etc/conda/activate.d/env_vars.sh and matching unsets in deactivate.d. This ensures variables load every time the conda_python3 kernel starts. Add as many export VAR=VALUE lines as needed in the same script instead of separate echo calls.