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 262 times
4
Sun Bear
- 2,078
- 5
- 26
- 70
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
- 263
- 2
- 14
-
Yes. Yes. Which file should I write this instruction to? – Sun Bear Feb 28 '19 at 18:39
-
@SunBear I updated the answer. Vote the answer if it's useful. – JamesThomasMoon Feb 28 '19 at 19:26