first off all I'm using oh-my-zsh as bash. I've added my API-Key to the .zshrc file as:
export MYKEY=xxxaldjlsdfjxxxx
Run source on the .zshrc. When I access this environment variable from the terminal with:
python3
>>> import os
>>> mykey = os.environ.get('MYKEY')
>>> print(mykey)
and this prints me the value of the key. Now I'm writing a python script with Visual Studio Code from where I want to access the key. The workspace of the project is located at /Users/myname/Documents/Projectname
If I now run the same code as in terminal:
import os
mykey = os.environ.get('MYKEY')
print(mykey)
I get a 'None' as output.