Skip to content

Behavior of uv pip install different from docs #7123

@kdheepak

Description

@kdheepak

From the docs - https://docs.astral.sh/uv/pip/environments/#discovery-of-python-environments:

When running a command that mutates an environment such as uv pip sync or uv pip install, uv will search for a virtual environment in the following order:

  • An activated virtual environment based on the VIRTUAL_ENV environment variable.
  • An activated Conda environment based on the CONDA_PREFIX environment variable.
  • A virtual environment at .venv in the current directory, or in the nearest parent directory.

If no virtual environment is found, uv will prompt the user to create one in the current directory via uv venv.

Specifically, the docs say "if no virtual environment is found, uv will prompt the user to create one in the current directory via uv venv".

I'm not experiencing this:

image

I'm getting error: No virtual environment found.

This is either a bug or the documentation should be updated.

$ uv --version
uv 0.4.6 (84f25e8cf 2024-09-05)

Metadata

Metadata

Assignees

Labels

error messagesMessaging when something goes wrong

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions