I've set the environment variable in the shell like this
export DEPLOY=development and running this returns "development"
echo $DEPLOY However... this returns none in python.
import os os.environ.get("DEPLOY") and this raises a key error
os.environ["DEPLOY"] I've deleted the .pyc files and restarted my IDE...
Any ideas?
export, of course it can't inherit the variable from that.export, that Python instance does get a copy of the variable (regardless of which directory you are running it in) as long as you didn'texitthat shell in the meantime. (This is all assuming you are not on Windows, where the mechanics are more twisty and perverse.)