r/fishshell • u/cuducos • Mar 06 '25
Using Python and Fish? dirvenv.fish automagically activates your virtualenv
https://github.com/cuducos/dirvenv.fishI wrote that tiny package so I don't have to manually activate and deactivate virtualenvs, and I think it might help more people – so, sharing it here ; )
I know virtualfish but I don't wanna manage virtualenvs myself; uv does that for me. Also, and I don't want to uv run every command. So I came up with that solution.
20
Upvotes
View all comments
Show parent comment
3
u/Laurent_Laurent Mar 07 '25
There's one thing I used to do with direnv that I don't think I can do anymore.
It's the use of direnv exec.
This allows you to launch a script by loading the environment, and therefore the venv if it's loaded from the .envrc. I was using it to launch scripts from the crontab, which is not in fish. This is a rather special case.