Skip to content

docs: update virtual environment activation commands for Windows - #2394

Open
Antonino Iaria (theiari) wants to merge 5 commits into
microsoft:mainfrom
theiari:docs/fix-windows-venv-readme
Open

docs: update virtual environment activation commands for Windows#2394
Antonino Iaria (theiari) wants to merge 5 commits into
microsoft:mainfrom
theiari:docs/fix-windows-venv-readme

Conversation

@theiari

Copy link
Copy Markdown

Context

The README.md currently instructs users to activate their virtual environment using source .venv/bin/activate. On Windows platforms, including Windows on ARM or when using Unix-like shells on Windows (e.g., Git Bash, MSYS2), virtual environments generated by either python -m venv or uv venv use .venv/Scripts/activate instead of .venv/bin/activate.

Attempting to run source .venv/bin/activate on Windows results in a No such file or directory error.

Summary of Changes

  • Updated the Prerequisites section of README.md to explicitly show activation commands for both Linux/macOS and Windows environments.
  • Added Windows-specific pathing for both standard Python venv and uv venv workflows.

Proposed README Changes

With the standard Python installation, you can create and activate a virtual environment using the following commands:

# On macOS/Linux:
python -m venv .venv
source .venv/bin/activate

# On Windows (PowerShell / Command Prompt):
python -m venv .venv
.venv\Scripts\activate

# On Windows (Git Bash / Bash):
python -m venv .venv
source .venv/Scripts/activate

If using `uv`, you can create and activate a virtual environment with:

# On macOS/Linux:
uv venv --python=3.12 .venv
source .venv/bin/activate

# On Windows:
uv venv --python=3.12 .venv
.venv\Scripts\activate
# or in Git Bash:
source .venv/Scripts/activate

@theiari

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant