Skip to content

Cannot create venv due to missing venvlaunchert_d.exe for Python 3.13td venv on Windows #126497

Closed
@XuehaiPan

Description

@XuehaiPan

Bug report

Bug description:

When Python 3.13 is installed with both Include_debug=1 and Include_freethreaded=1 (i.e. cp313td), there should be a corresponding venvlaunchert_d.exe for it.

python_exe = os.path.join(scripts, f'venvlaunchert{exe_d}.exe')

There is a launcher with no suffix for 3.13, a launcher with t suffix for 3.13t, and a launcher with _d suffix for 3.13d. But there is no launcher with t_d suffix for 3.13td.

Repro:

#  % PanXuehai @ VirtualBox in ~ [21:25:38]
$ pyenv uninstall 3.13.0
pyenv: version '3.13.0' not installed
#  % PanXuehai @ VirtualBox in ~ [21:25:43]
$ C:\Users\PanXuehai\.pyenv\pyenv-win\install_cache\python-3.13.0-amd64.exe /quiet /uninstall | Out-Default
#  % PanXuehai @ VirtualBox in ~ [21:25:47]
$ C:\Users\PanXuehai\.pyenv\pyenv-win\install_cache\python-3.13.0-amd64.exe /quiet SimpleInstall=1 InstallAllUsers=0 Include_dev=1 Include_lib=1 Include_exe=1 Include_pip=1 Include_tools=1 Include_launcher=0 Include_test=0 Include_debug=1 Include_symbols=1 Include_freethreaded=1 TargetDir="C:\Users\PanXuehai\.pyenv\pyenv-win\versions\3.13.0" 2>&1 | Out-Default
#  % PanXuehai @ VirtualBox in ~ [21:27:18]
$ cd C:\Users\PanXuehai\.pyenv\pyenv-win\versions\3.13.0
#  % PanXuehai @ VirtualBox in ~\.pyenv\pyenv-win\versions\3.13.0 on git:master [21:28:14]
$ ls .\Lib\venv\scripts\nt\

   Directory: C:\Users\PanXuehai\.pyenv\pyenv-win\versions\3.13.0\Lib\venv\scripts\nt

activate.bat            deactivate.bat          venvlauncher_d.exe      venvlauncher.exe        venvlauncher.pdb
venvlaunchert_d.pdb     venvlaunchert.exe       venvlaunchert.pdb       venvwlauncher_d.exe     venvwlauncher.exe
venvwlauncher.pdb       venvwlaunchert_d.pdb    venvwlaunchert.exe      venvwlaunchert.pdb

https://github.com/metaopt/optree/actions/runs/11704285076/job/32596414844?pr=172

$ python3.13t_d -m venv venv
Unable to copy 'C:\\Users\\runneradmin\\.pyenv\\pyenv-win\\versions\\3.13.0\\Lib\\venv\\scripts\\nt\\venvlaunchert_d.exe' to 'D:\\a\\optree\\optree\\venv\\Scripts\\python.exe'
Unable to copy 'C:\\Users\\runneradmin\\.pyenv\\pyenv-win\\versions\\3.13.0\\Lib\\venv\\scripts\\nt\\venvlaunchert_d.exe' to 'D:\\a\\optree\\optree\\venv\\Scripts\\python_d.exe'
Unable to copy 'C:\\Users\\runneradmin\\.pyenv\\pyenv-win\\versions\\3.13.0\\Lib\\venv\\scripts\\nt\\venvlaunchert_d.exe' to 'D:\\a\\optree\\optree\\venv\\Scripts\\python3.13t.exe'
Unable to copy 'C:\\Users\\runneradmin\\.pyenv\\pyenv-win\\versions\\3.13.0\\Lib\\venv\\scripts\\nt\\venvlaunchert_d.exe' to 'D:\\a\\optree\\optree\\venv\\Scripts\\python3.13t_d.exe'
Unable to copy 'C:\\Users\\runneradmin\\.pyenv\\pyenv-win\\versions\\3.13.0\\Lib\\venv\\scripts\\nt\\venvwlaunchert_d.exe' to 'D:\\a\\optree\\optree\\venv\\Scripts\\pythonw.exe'
Unable to copy 'C:\\Users\\runneradmin\\.pyenv\\pyenv-win\\versions\\3.13.0\\Lib\\venv\\scripts\\nt\\venvwlaunchert_d.exe' to 'D:\\a\\optree\\optree\\venv\\Scripts\\pythonw_d.exe'
Unable to copy 'C:\\Users\\runneradmin\\.pyenv\\pyenv-win\\versions\\3.13.0\\Lib\\venv\\scripts\\nt\\venvwlaunchert_d.exe' to 'D:\\a\\optree\\optree\\venv\\Scripts\\pythonw3.13t.exe'
Unable to copy 'C:\\Users\\runneradmin\\.pyenv\\pyenv-win\\versions\\3.13.0\\Lib\\venv\\scripts\\nt\\venvwlaunchert_d.exe' to 'D:\\a\\optree\\optree\\venv\\Scripts\\pythonw3.13t_d.exe'
Error: [WinError 2] The system cannot find the file specified
image

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixesOS-windowstopic-venvRelated to the venv moduletype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions