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
read -r python_version ve <<<$($python -c "import importlib.util as u, platform as p;ve='venv' if u.find_spec('venv') else ('virtualenv' if u.find_spec('virtualenv') else '');print('.'.join(p.python_version_tuple()[:2])+' '+ve)")
Ended up here because I had the same issue - is there a way to determine the python version and include it as part of the direnv instead of having to install it on the system prior? I don't really want to have python installed system-wide if I don't have to.
Describe the bug
I am creating a venv using nix-shell. Using
layout python
in.direnv
yields the following errors:If I manually activate the venv before cd'ing into the directory, it works as expected.
To Reproduce
nix-shell -p python39
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
echo layout python > .envrc
direnv allow
Expected behavior
The venv should activate, and
which python3.9
should point to.venv/bin/python3.9
Environment
Additional context
The text was updated successfully, but these errors were encountered: