I am using Elpy on Emacs and using pipenv. When I start an Elpy Python shell or send the current buffer to the shell, I cannot get the environment variables that I set in the terminal. But I would very much like to be able to send my code and env vars over to the Elpy shell, how can I do that?
The virtual environment is works fine because all my packages are there; also, if I use the pipenv-shell, I can access my env vars.
I checked on os.environ
and it shows that I'm using the correct virtual environment, and everything else looks just about right there, just none of the variables I set myself. Is there a way to set the environment variables from Elpy? I looked at the documentation, but I am still unclear on this. I would rather use the OS environment variables than "project variables" or anything like that because I need to be able to edit and run the code outside of Emacs as well.
Edit: OK, I realized that I can use M-x setenv to set the environment variable, which does what I need, but I would still like to know how to get Elpy to recognize already set environment variables.