1

I used PyInstaller to convert my Python program to an executable, but my friend’s computer thinks it is a virus, so they can’t run it as their computer is managed by their organization.

How can I distribute my Python program as a standalone EXE without a virus warning?

Julia
  • 1,950
  • 1
  • 9
  • 22
Abdulaziz
  • 19
  • 2
  • This isn't python-specific, but it may help: https://softwareengineering.stackexchange.com/questions/191003/how-to-prevent-my-executable-being-treated-from-av-like-bad-or-virus – Simon Crowe Dec 17 '22 at 15:38
  • No, this is windows security policy. Look at this https://stackoverflow.com/questions/252226/signing-a-windows-exe-file – HindicatoR Dec 17 '22 at 15:39
  • THis can often time be avoided by simply compiling the executable in a minimal clean virtual environment. And if that doesn't work, compiling pyinstaller itself from source can often times solve the problem... Certain libraries will trigger a positive no matter what though – Alexander Dec 17 '22 at 18:51

1 Answers1

1

PyInstaller due to its nature (unpacking executable files and running them) is likely to cause false positives with avirus software. To add to this Smartscreen and alike oftentimes just flag uncommon software (as in: software that is not being used by a lot of people such as a custom written program) as malware.

All in all you can't really easily solve this. You could perhaps distribute Python itself (which is signed and known to not be a virus) together with a batch-script so you don't have to convert your code to an executable, as this is likely to always cause issues.

Vincent
  • 482
  • 4
  • 15