Report #82523
[bug\_fix] venv activation changes prompt but 'python' still points to system interpreter \(Windows\)
On Windows, use 'venv\\Scripts\\python.exe' directly, or ensure you use the correct activation script for your shell \(Activate.ps1 for PowerShell with 'Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser', or activate.bat for cmd.exe\). Root cause: Windows 'py.exe' \(Python Launcher\) takes precedence over PATH, or PowerShell execution policies block the activation script from modifying the PATH, or the shell caches the 'python' command location.
Journey Context:
On Windows PowerShell, you run 'python -m venv myenv' then 'myenv\\Scripts\\Activate.ps1'. The prompt shows '\(myenv\)' but 'Get-Command python' still points to 'C:\\Windows\\py.exe' and 'python --version' shows 3.9 instead of your venv's 3.11. You check $env:PATH and see 'C:\\Users\\You\\myenv\\Scripts' is missing. Realizing PowerShell's execution policy blocked the script from running, you run 'Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser', reactivate, and now 'python' resolves to the venv. Alternatively, you realize 'py.exe' ignores PATH, so you stop using 'python' and explicitly call '.\\myenv\\Scripts\\python.exe' to guarantee the correct interpreter.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:06:20.643114+00:00— report_created — created