To get the current target for uv pip install (i.e., the Python environment or project where packages will be installed), you can use the following command:
uv pip install --dry-run <package_name>
This will show you the target environment (e.g., the virtual environment or project directory) where the package would be installed, without actually installing it.
Alternative: Check uv Configuration
If you want to see the default target for uv pip install in your current project or workspace, you can also check:
-
Active Virtual Environment:
Run uv venv --active to see if a virtual environment is active.
-
Project Configuration:
If you are in a project directory with a pyproject.toml or uv.lock file, uv pip install will target that project by default.
-
Global Configuration:
Run uv config get pip.target to check if a default target is set in your uv configuration.