4

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?

Sun Bear
  • 2,078
  • 5
  • 26
  • 70

1 Answers1

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