You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows AV software causes 0.5 second delay for unsigned binaries #10288
This delay is related to this particular computer with a antivirus software doing some checks when modified .exe are launched. I guess it is a quite common situation for UV users on Windows. It would be nice to find a solution. Possibly UV could do something to produce files that are not checked at startup by antivirus software. Alternatively, it would be nice to document how to avoid these startup delays.
I once worked in a large Enterprise that was testing a security tool on Windows that implemented an allow list, however the allow list wasn't stored on the computer, a hash of the executable was made and sent over the network on each process open.
Further, when starting multiple processes simultaneously the security tool’s response time scaled superlinearly, I had examples, like opening PyCharm, where it took over 30 seconds and started to time out (I, and several other developers, successfully made the case that this meant it was unworkable on our machines). It's a wild world of latency inducing security tools out there.
Indeed virtual envs from Python installed from the official installers do not suffer from startup delays. python.exe in virtual envs is just a copy and just check a text file pyvenv.cfg next to it.
For uv tools, find a great solution not involving modifying .exe files 🙂
I don't yet now how to do this but it seems that for some antivirus programs, one can add a kind of white list of programs or directories (see https://discuss.python.org/t/slow-startup-on-windows-for-virtual-environments/75758/29). If it is indeed possible for popular security software, it might be nice to add a note on UV tools documentation.
Moreover, I confirm that it is due to an antivirus software (see https://discuss.python.org/t/slow-startup-on-windows-for-virtual-environments/75758/34) and that the solutions are to sign binaries (python.exe in the venvs, launchers for python entrypoints, Rust applications like ruff.exe, etc.) and not modify binaries with shebang (what is done for launchers for python entrypoints). Instead of modifying binaries with shebang, one could use 2 files (black.exe and black-script.json for example).
changed the title [-]Windows: 0.5 second delay before startup for venv and tools[/-][+]Windows AV software causes 0.5 second delay for unsigned binaries[/+]on Dec 15, 2025
Activity
charliermarsh commentedon Jan 3, 2025
I'm not sure that there's much we can do here. Did you learn anything that we can apply concretely from the discussion.python.org thread?
samypr100 commentedon Jan 3, 2025
Wow! I wonder what those slow AV's are searching for / doing. These are the results on my Windows system.
notatallshaw commentedon Jan 3, 2025
I once worked in a large Enterprise that was testing a security tool on Windows that implemented an allow list, however the allow list wasn't stored on the computer, a hash of the executable was made and sent over the network on each process open.
Further, when starting multiple processes simultaneously the security tool’s response time scaled superlinearly, I had examples, like opening PyCharm, where it took over 30 seconds and started to time out (I, and several other developers, successfully made the case that this meant it was unworkable on our machines). It's a wild world of latency inducing security tools out there.
samypr100 commentedon Jan 4, 2025
Indeed, I've also been there a couple of times 😭
paugier commentedon Jan 4, 2025
I don't come from Windows, so I don't understand everything but it seems (https://discuss.python.org/t/slow-startup-on-windows-for-virtual-environments/75758/27) that it is important to
Indeed virtual envs from Python installed from the official installers do not suffer from startup delays.
python.exein virtual envs is just a copy and just check a text filepyvenv.cfgnext to it.For
uv tools, find a great solution not involving modifying .exe files 🙂I don't yet now how to do this but it seems that for some antivirus programs, one can add a kind of white list of programs or directories (see https://discuss.python.org/t/slow-startup-on-windows-for-virtual-environments/75758/29). If it is indeed possible for popular security software, it might be nice to add a note on UV tools documentation.
samypr100 commentedon Jan 4, 2025
Fair, python build standalone binaries would benefit from signing
Which .exe files? Executable scripts launchers are generated on the fly, they're not pre-existing.
paugier commentedon Jan 7, 2025
Note that it also apply to Rust applications like ruff. Ruff installed with UV is very slow on this computer.
Moreover, I confirm that it is due to an antivirus software (see https://discuss.python.org/t/slow-startup-on-windows-for-virtual-environments/75758/34) and that the solutions are to sign binaries (python.exe in the venvs, launchers for python entrypoints, Rust applications like ruff.exe, etc.) and not modify binaries with shebang (what is done for launchers for python entrypoints). Instead of modifying binaries with shebang, one could use 2 files (black.exe and black-script.json for example).
[-]Windows: 0.5 second delay before startup for venv and tools[/-][+]Windows AV software causes 0.5 second delay for unsigned binaries[/+]