[issue36964] `python3 -m venv NAME`: virtualenv is not portable

Marco Sulla report at bugs.python.org
Sat May 25 18:12:15 EDT 2019


Marco Sulla <launchpad.net at marco.sulla.e4ward.com> added the comment:

> if you have entry points installed then moving them to another 
> machine would break their shebang lines.

Not if you port it on the same OS using, for example

#!/usr/bin/env python3

> And even if you do it on your local machine there's no guarantee
> something else wasn't structured to be directory-specific.

You are telling about user code, not the virtualenv itself. If the user doe not write the code in such a way it's portable, it's his fault. But this should not stop people that do it right to try to port the venv if possible.

I think the modification
VIRTUAL_ENV="$(dirname "$(dirname "$(readlink -nf "$0")")")"

is very little and quite robust. Don't know how to do in fish and csh shells, but in bash and sh it works.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36964>
_______________________________________


More information about the Python-bugs-list mailing list