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

> But the nice part is that both of those work, and you can pick whichever one you prefer.

Yep. And so does the pyenv approach (which I understand involves permanently adding a relative path to $PATH, wherein the system might place a stub executable that invokes the venv associated with the current working directory).

And so do hand-made subshell-based approaches, etc. etc.

In "development mode" I use my activation-script-based wrappers. When just hacking around I generally just give the path to the venv's python explicitly.



I use your "hacking around" method for things like cron jobs, with command lines like:

  * * * * * /path/to/project/.venv/python /path/to/project/foo.py
It's more typing one time, but avoids a whole lot of fragility later.




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

Search: