-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In case VIRTUAL_ENV is different from .venv UV_PROJECT_ENVIRONMENT should be created automatically #7778
Comments
We intentionally don't support using the "active" virtual environment for a project. More context in #6834 which links to much more discussion. |
@zanieb So how can I use my cpu-based-venv without removing the other one? |
Unfortunately, this doesn't allow me to keep all virtual environments at one place under Currently I usually name project environments with the same name as project and keep them under one folder in |
@adhadse that's tracked in #1495 @sglbl we don't really support that yet. You can hack it with |
@adhadse for this specific use case, I use |
Right now, I'm not interested in fiddling with this issue. I'm going with how uv does it. I'll come back to it later once I start using uv with more and more projects. |
Hi all,
If I understand correctly, the current behaviour of uv add when
VIRTUAL_ENVIRONMENT
is different than.venv
is to raise a warning and create a .venv environment where the dependency will be created.warning:
VIRTUAL_ENV=.venv-py312does not match the project environment path
.venvand will be ignored Using Python 3.12.6 interpreter at: /opt/homebrew/opt/python@3.12/bin/python3.12 Creating virtualenv at: .venv
I believe it would be more intuitive and more efficient when the
VIRTUAL_ENV
is different from .venv that theUV_PROJECT_ENVIRONMENT
is set automatically toVIRTUAL_ENV
by uv init. This will remove an extra step in setting up a project.If a users wants to use a different environment from the one set in
VIRTUAL_ENV
then they could explicitly set theUV_PROJECT_ENVIRONMENT
.Thanks for considering this request.
Achilleas
The text was updated successfully, but these errors were encountered: