This is strange to me. I have set a variable in bash and exported it, like this:
export EMAIL="example@example.com"
I have used the command, "source ~/.bash_profile" to reset bash, and have even logged out and back in, and here's the issue:
All is good when I do this in the Python 3 interpreter:
>>> import os
>>> print(os.environ["EMAIL"])
example@example.com
All is good when I put the above into a script and run it in terminal.
Jeffreys-MacBook-Pro:jeff$ python3 check_var.py
example@example.com
However, when I run the script in my text editor, Sublime Text 2, I get this:
raise KeyError(key) from None
KeyError: 'EMAIL'
All my scripts run fine in the text editor but, when I try to grab this variable from the environment running the script in the text editor, it chokes. Any thoughts on how to resolve this issue?