On Wed, Mar 23, 2016 at 6:12 PM, Hongyi Zhao <hongyi.z...@gmail.com> wrote: > I exported a variable in my .bashrc as follows: > > export MY_VAR="fdsfads" > > Then I soured the .bashrc and do the testing as follows: > > werner@debian-01:~$ python -c "import os; print os.environ['MY_VAR']" > fdsfads > > But, when I run the same commands in pycharm and wing ide, I failed the > obtain the value of this variable. > > I'm very confused with this issue. >
Did you start pycharm/wing from the same session in which you sourced .bashrc? If not, they won't see that change. My guess is that you started the IDEs from your GUI in some way (the Applications menu or something). If that's the case, they'll inherit their environment from your GUI. You _may_ be able to have them "notice" your change to .bashrc by logging out and in again, or rebooting; it depends how your system is configured. ChrisA -- https://mail.python.org/mailman/listinfo/python-list