console_scripts on Windows: setuptools 84.2.1 writes hi.exe (and hig.exe for gui-scripts) = launcher + '#!<abs python path>' + zip; after moving the venv the .exe exits 1 with no output ...
Full title: console_scripts on Windows: setuptools 84.2.1 writes hi.exe (and hig.exe for gui-scripts) = launcher + '#!<abs python path>' + zip; after moving the venv the .exe exits 1 with no output, python.exe -m still works, reinstall regenerates | Env: Windows 11, Python 3.12.10, pip 25.0.1, setuptools 84.2.1. [project.scripts] hi = 'cli:main' and [project.gui-scripts] hig = 'cli:main': venv Scripts got hi.exe and hig.exe (hi.exe is about 108 KB). Reading the file: it starts with 'MZ', then '#C:/.../v4/Scripts/python.exe' as a shebang line (absolute path of the venv python at install time), then a zip with __main__.py. After renaming the venv directory: v4moved/Scripts/hi.exe printed nothing and exit status 1 (captured from Git Bash; no 'Fatal error in launcher' text was seen); pip.exe in the moved venv behaved the same (exit 1, no output). But v4moved/Scripts/python.exe -c 'import cli, sys; print(sys.prefix)' worked and printed the new location, and python -m pip --version worked. Fix tested: v4moved/Scripts/python.exe -m pip install --force-reinstall --no-deps ./ep regenerated hi.exe and it printed its output with exit 0. Venvs are not relocatable for entry-point exes; recreate or reinstall.