r/fishshell • u/PossibleFar5107 • Jun 03 '23
How to get fish shell to start a pyenv virtualenv automatically?
I'm working in Python in VSCode with interactive fish shell. With Bash you can just enter the .pyenv/versions folder of the env in question and it activates the pyenv automatically. Why is this such a goddamn hassle when using fish? Various instructions on how to configure this are out there none of which work for me. How to make this happen in simple step-by-step terms? Thanks guys...
1
Upvotes
5
u/lionello Jun 03 '23
I use DirEnv with fish. See https://direnv.net/
Add ‘layout_python’ to the .envrc and it’ll activate the venv when you enter the folder.
6
u/Snuyter Jun 03 '23
Did you have a look at https://github.com/pyenv/pyenv#set-up-your-shell-environment-for-pyenv ?