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

How exactly does `uv` determine which is "the" venv? Is it simply based on the working directory like the `direnv`/`autoenv`/etc. workflows others are describing here?

It does seem like people have use cases for running code in a different environment vs. the one being actively used to develop the package.



It uses the content of the UV_PROJECT_ENVIRONMENT var env, which defaults to .venv. If you pass --active, it can also look whatever is in VIRTUAL_ENV and CONDA_PREFIX.

You can also force an env passing a complete path to --python




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

Search: