You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2016-02-13.09:47:36.194>created_at=<Date2015-12-10.15:15:28.900>labels= ['invalid', 'type-feature', 'library']
title='pyvenv: venvs cannot be moved because activate scripts hard-code paths'updated_at=<Date2016-02-13.09:47:36.193>user='https://bugs.python.org/moorecm'
venv/bin/activate contains an absolute path to the virtual environment. Is it possible to make that relative from activate itself so that the entire venv can be moved elsewhere and still work?
I found this using Jenkins to get a Perforce workspace, then build a virtual environment, and clone that for downstream jobs. The cloned workspaces are extracted elsewhere and when they activate the environment they're actually pointing back to the upstream job's venv.
Feel free to route this request as appropriate. I'm a new tracker user. Thanks!
It's been that way since the virtualenv days, and I presume there's a reason for it. virtualenv does have a '--relocatable' option, but it is still marked as experimental. Finding out why that is and addressing the issues would be a prerequisite for adding this enhancement to venv.
Indeed, and in fact *all* scripts written to a venv's bin directory hard-code the path to that venv's interpreter. This confers the benefit that such scripts never need the venv to be explicitly activated - you can e.g. point crontab entries to them directly.
You're better off making the Jenkins job build the environment in its workspace before using it - venvs are intended to be reproducible and, consequently, disposable.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: