Open pelamlio opened 2 weeks ago
What do you find to be wrong here? In other words, what behavior would you expect to see?
Not sure whether I can provide a clean answer.
In part, my issue was related to migrating to uv from an pre-existing development environment, and having a very limited knowledge of uv. Should other users take the same path, they might trigger the same behavior (subdirectories per env in the .venv directory).
Per the documentation (https://docs.astral.sh/uv/guides/projects/), it was not immediately clear that uv init would need an venv to be defined ab initio. More so, when the .venv could be created in the said project later (same url; Project structure).
My 2 cents.
Same problem here. I personally use the $HOME/.venv
directory to store regular venvs for other projects.
I was thinking, here are some steps to reproduce:
mkdir myroot
cd myroot
uv venv .venv/a
uv venv .venv/b
uv init testproject
The error from uv init
is:
error: Broken virtualenv `/home/user/myroot/.venv`: `pyvenv.cfg` is missing
This could be a bug because: there shouldn't be a problem with .venv
and testproject coexisting, and I don't think there is a problem if they are created in opposite order?
uv version 0.4.20 Linux Ubuntu 24.04.1 LTS
When transitioning (previously using venv, not virtualenv), uv does not find any pyvenv.cfg file directly under the .venv directory and generates an error:
uv init test error: Broken virtualenv
/home/<user>/.venv
:pyvenv.cfg
is missingShould the directory be removed or an empty pyvenv.cfg be created at the root of ~/.venv, the command completes as expected.