can I nest virtualenvs?

2020-06-01 06:59发布

问题:

is it possible to nest 2 virtualenvs?

I would like to have a base virtualenv and then a more specific virtualenv that accesses all the packages from the base virtualenv and then has its own.

Any hint appreciated, thanks.

回答1:

No, this isn't currently possible. There is a feature request and a patch for the functionality out there though:

https://github.com/pypa/virtualenv/issues/33



回答2:

You can run in trouble when running python scripts of a virtualenv as subprocesses of another virtualenv. I've found useful to remove from the environment of the subprocess PYTHONPATH and BUILDOUT_ORIGINAL_PYTHONPATH.