News for hackers. Stuff that matters.
Re:Ask HN: Machine Learning Engineers, what do you do at work? by tmnvix on Sunday June 09, 2024 @04:52PM (#40627527)
After many years of Django development I've settled on what I find the simplest solution. It includes activation of virtual environments when I cd into a directory.

pyenv for installing and managing python versions.

direnv for managing environments and environment variables (a highly underrated package imo).

With those two installed I just include a .envrc file in every project. It looks like this:

layout python ~/.pyenv/versions/3.11.0/bin/python3

export VARIABLE1=variable1

export VARIABLE2=variable2

etc...

Re:Ask HN: Machine Learning Engineers, what do you do at work? by fragmede on Sunday June 09, 2024 @11:59PM (#40630013)
Oh nice. Stick

    PYTHONPATH="`pwd`/venv/lib/python-3.11/site-packages"
or whatever in .envrc and Bob's your uncle.