Skip to content

Support for custom environment variables #1124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
NZSmartie opened this issue Jan 24, 2018 · 5 comments
Closed

Support for custom environment variables #1124

NZSmartie opened this issue Jan 24, 2018 · 5 comments

Comments

@NZSmartie
Copy link

Hi, virtualenv doesn't provide a mechanism for setting up environment variables and tearing them down again after deactivate.

A use case would be allowing setting of PYTHON_EGG_CACHE to $VIRTUAL_ENV/.python-egg (related issue: #459).

I'm aware there is the possibility of using autoenv or direnv to setup environment variabls for me. but they fall outside the scope of invoking $VIRTUAL_ENV/bin/activate and would require manually modifying the activate file if I wish to keep it all contained within a virtual env.

@Ekultek
Copy link

Ekultek commented Jan 24, 2018 via email

@stale
Copy link

stale bot commented Jan 14, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 14, 2019
@stale stale bot closed this as completed Jan 21, 2019
@warnes
Copy link

warnes commented Jan 23, 2020

I would really appreciate this feature. It would allow me to consolidate multiple configure files into venv.

For my purposes, it would be ideal to placing a file, say env.txt in the venv bin directory with definitions a standard format:

VARNAME=value
OTHERVAR=othervalue

and then having the activate and deactivate scripts process this file to set/unset the specified variables.

@m1racoli
Copy link

m1racoli commented May 2, 2021

This would be really nice. We have some environment variables, which are virtual env specific, and would have liked to be set when activating the environment.

Those variables could be defined on environment creation like this for example:

virtualenv --env VARNAME=value ${VENV_PATH}

@gaborbernat
Copy link
Contributor

Seems no longer an issue as no one reported it in 3 years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants