On 2020-03-11, Robin Becker <ro...@reportlab.com> wrote: > I'm trying to understand why python 3.8.2 venv behaves differently > when it is executed va a link
Because site.py contains a function called venv() which looks up the path of the executed python binary, and searches for the virtual environment relative to that path. If you're executing the python binary via a link, it will look relative to the link, not the target of the link. > so the linked version of the venv python sees the base python site > packages and not the expected venv site-packages. > > Is there a way to make the link work properly. No. Unless you count making a shell script in the place you want which does nothing except exec the python binary inside the venv, i.e.: cat >pythonish #!/bin/sh exec some/other/python "$@" ^D -- https://mail.python.org/mailman/listinfo/python-list