Skip to content
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

Why is .venv created on every uv command invocation despite the environment being available? #10305

Closed
aaqibb13 opened this issue Jan 5, 2025 · 1 comment
Labels
question Asking for clarification or support

Comments

@aaqibb13
Copy link

aaqibb13 commented Jan 5, 2025

If I am creating a virtual environment using uv via the following:

uv venv venv

and then activating the virtual environment it via:

source venv/bin/activate

Shouldn't the already created virtual environment (venv in this case) be referenced on the subsequent uv command invokations?
Why is the .venv still created?

As per the docs:
If the venv directory is not PEP 405 compliant, that's when the already present virtual environment will be ignored.
But if my venv is already PEP 405 complaint since I created it via uv itself, why is this happening?
Am I missing something here?

@zanieb
Copy link
Member

zanieb commented Jan 5, 2025

Yeah, we don't respect activated environments in projects. See #6834 and linked discussions

https://docs.astral.sh/uv/pip/environments/#using-a-virtual-environment is part of the uv pip documentation and specific to that subsection of uv.

See https://docs.astral.sh/uv/concepts/projects/layout/#the-project-environment for documentation on environments in projects.

@zanieb zanieb added the question Asking for clarification or support label Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

3 participants