Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I use pyenv + direnv. If my project uses 3.10.3 I just add `layout pyenv 3.10.3` to my .envrc file. This creates a venv in the `.direnv` subdirectory. When I `cd` into the dir my environment is automatically configured to use the virtual environment and when I `cd` out the configuration is removed.

If you want to use poetry + direnv, that's also an option.

https://github.com/direnv/direnv/wiki/Python#pyenv https://github.com/direnv/direnv/wiki/Python#poetry



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: