I set some environment variables in /etc/profile or .bashrc ,all can not be use in intellij with python when runtime. so I have to set those variables in in intellij in here bellow. idea set global environment variables for all projects
however, i run a script code like this :
import os
print os.environ['PYTHONUNBUFFERED'] # intellij auto set ,work fine
print os.environ['CUDA_HOME']` # i set , failed, key_error.
the output surprised me. they both be set in the same place and same format. but behave different.
anyone can explain? thanks.
Setting environment variables in .bashrc make them relative to one user's session only.
And /etc/profile limit env variables to the shell.
Set your variables in : /etc/environment or /etc/security/pam_env.conf
See : http://www.linux-pam.org/Linux-PAM-html/sag-pam_env.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With