I am trying to call a variable which has been exported in the .bash_profile file. This is how it has been written.
export TEST='test'
After saving this change in the .bash_profile file, I type this into terminal:
source ~/.bash_profile
Upon typing env into terminal, TEST=test is shown. Furthermore, upon typing echo $TEST, terminal returns test.
The problem I have is that when I try to call this variable into a python script using Pycharm, the script returns None.
The code is:
import os
print(os.environ.get('TEST'))
How can I get the script to output test?
It is also worth noting that this is all being done in a Conda virtual environment.
What have I done wrong?