StringsOnFire StringsOnFire - 3 months ago 10
Python Question

How can I use a postactivate script using Python 3 venv?

I'm using

venv
(used
pyvenv
to create the environment) and would like to set up environment variables here, but
postactivate
looks like a
virtualenv
thing. Can this be done with
venv
?

Answer

venv has the activate script which you can modify to add your environment variables.

I would add the variables at the bottom, making a nice comment block to clearly separate the core functionality and my custom variables.