3 ms·
Most of the time I just stick with this in a .envrc file: export VIRTUAL_ENV=${XDG_CACHE_HOME:-~/.cache}/virtualenvs/$(basename $PWD) export PATH="${VIRTUA
by aequitas 7y ago
Most of the time I just stick with this in a .envrc file:
export VIRTUAL_ENV=${XDG_CACHE_HOME:-~/.cache}/virtualenvs/$(basename $PWD)
export PATH="${VIRTUAL_ENV}/bin:$PATH"
python3 -m venv $VIRTUAL_ENV
I just enter the directory and the environment is created/'activated'.
In all the years I never had any need to use the real activate method. Just running Python and scripts directory from the bin/ in the virtualenv is enough to run 'inside the env'.