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?

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
2
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.