From 315fc1792a0f3ab153ef1a01ae50f5b431b06a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric?= Date: Mon, 27 Jan 2025 20:24:47 +0100 Subject: [PATCH] Update documentation for activating virtual environments in different shell (#11000) ## Add activation commands for fish shell and other alternative shells While trying to use uv with fish shell, I encountered an issue as `source .venv/bin/activate` didn't work. The documentation didn't specify that fish shell requires using `source .venv/bin/activate.fish` instead. I created issue #10986 to address this. This PR improves the documentation by: - Adding the correct activation command for fish shell: `source .venv/bin/activate.fish` - Adding the correct activation command for Nushell: `use .venv\Scripts\activate.nu` - Adding the correct activation command for Tcsh: `use .venv/bin/activate.csh` This will help users of alternative shells to properly activate their virtual environments without encountering the same confusion I experienced. Fixes #10986 --------- Co-authored-by: Zanie Blue --- docs/pip/environments.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/pip/environments.md b/docs/pip/environments.md index 0b27b5e20..2d6ed3bba 100644 --- a/docs/pip/environments.md +++ b/docs/pip/environments.md @@ -57,6 +57,30 @@ The virtual environment can be "activated" to make its packages available: $ .venv\Scripts\activate ``` +!!! note + + The default activation script on Unix is for POSIX compliant shells like `sh`, `bash`, or `zsh`. + There are additional activation scripts for common alternative shells. + + === "fish" + + ```console + $ source .venv/bin/activate.fish + ``` + + === "csh / tcsh" + + + ```console + $ source .venv/bin/activate.csh + ``` + + === "Nushell" + + ```console + $ use .venv\Scripts\activate.nu + ``` + ## Using arbitrary Python environments Since uv has no dependency on Python, it can install into virtual environments other than its own.