I am running python 3.6 in a pipenv shell. I want to set the value of this python environment variable PYTHONASYNCIODEBUG to 1 without affecting my user environment variables that are outside of the pipenv shell. How do I make this setting?
Asked
Active
Viewed 328 times
4
Sun Bear
- 3,014
1 Answers
0
in a shell
export PYTHONASYNCIODEBUG=1
Yes?
Perhaps you are wondering how to do this only when in a pipenv environment from a shell?
Assuming a bash shell, detect when in a pipenv environment by checking PIPENV_ACTIVE
if [ "${PIPENV_ACTIVE+x}" == '1' ]; then
export PYTHONASYNCIODEBUG=1
fi
.env file
A different approach is to use a .env file. Create such a file in your project directory with contents
PYTHONASYNCIODEBUG=1
JamesThomasMoon
- 303
- 2
- 14