Skip to content

🐛 fix(create): add pythonw3.exe to Windows venvs#3073

Merged
gaborbernat merged 1 commit into
pypa:mainfrom
gaborbernat:rustpython
Feb 25, 2026
Merged

🐛 fix(create): add pythonw3.exe to Windows venvs#3073
gaborbernat merged 1 commit into
pypa:mainfrom
gaborbernat:rustpython

Conversation

@gaborbernat

Copy link
Copy Markdown
Contributor

When users install GUI packages via python3 -m pip install inside a virtualenv on Windows, the generated script wrapper references pythonw3.exe — because distlib derives the windowed executable name by replacing python with pythonw in the current interpreter's filename. 🐛 Since virtualenv creates python3.exe but not the corresponding pythonw3.exe, these GUI scripts fail to launch.

The fix adds pythonw3.exe as an alias of pythonw.exe in the CPython Windows creator, mirroring how python3.exe is already unconditionally created alongside python.exe. This is consistent with the existing pattern where every python variant has a matching pythonw counterpart.

Fixes #3072.

When users run `python3 -m pip install` for a GUI package inside a
virtualenv, distlib generates a script shebang pointing to
`pythonw3.exe` (via string replacement on the executable name).
virtualenv creates `python3.exe` but was missing the corresponding
`pythonw3.exe`, causing GUI scripts to fail.

Fixes pypa#3072.
@gaborbernat gaborbernat enabled auto-merge (squash) February 25, 2026 17:39
@gaborbernat gaborbernat disabled auto-merge February 25, 2026 18:18
@gaborbernat gaborbernat merged commit b1ca37f into pypa:main Feb 25, 2026
114 of 115 checks passed
This was referenced Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pythonw3.exe is missing

1 participant