As a workaround, you can create a global venv that acts a lot like --user
does now.
NB: this works for scripts that are part of the packages installed in the venv, but scripts that use e.g. #!/usr/bin/python3
will not be able to access the modules from the venv, only scripts called via ~/.venv/bin/python3
(or ~/.venv/bin/python
, ~/.venv/bin/python3.11
etc.) will be able to access those.
python3 -mvenv --system-site-packages --without-pip ~/.venv
Add this to your ~/.bashrc
:
if [ -d ~/.venv/bin ] && [[ ":$PATH:" != *:"$HOME/.venv/bin":* ]]; then
PATH="$HOME/.venv/bin:$PATH"
fi