Is my PyInstaller executable really a virus or just a false positive?
Asked by
LunarGeologist
I recently used the command `python -m PyInstaller --onefile --windowed tictactoe.py` to create an executable file. When I scanned the file on VirusTotal, it was flagged as a virus and Trojan by 11 out of 72 scanners. Should I be worried, or is this just a false positive?
Answers
Can't help but chuckle at this, but no worries, the FBI isnโt coming for you!
Reply to this answer
Did you write the code yourself? If yes, then you shouldnโt worry about it being a virus. Just know that any third-party libraries you're using could potentially introduce risks, especially if they aren't from the standard library.
Reply to this answer
Monthly reminder that most antivirus programs are overhyped. If you know your stuff, they often do more harm than good.
Reply to this answer
Honestly, this happens often with Python exes. Even signed ones can sometimes trigger false alarms. It's a pain, but there's not much to do about it.
!ReduceTheHeat: But isnโt using a real code signing certificate the way to go?
Reply to this answer
In my experience, antivirus software will flag any unsigned executables as potential viruses. Itโs a common precaution.
Reply to this answer
You should definitely consider signing your executable with a proper certification. This process differs based on your operating system and the target OS, but thereโs plenty of documentation out there to help with it.
!do not stack: Thanks! I just wanted to be sure I hadn't picked up a Trojan.
Reply to this answer
For me, using the `--onefile` flag triggered the warning. Have you thought about trying to build it without that option?
Reply to this answer
When you create an unsigned executable, it raises flags for antivirus programs. They usually err on the side of caution with unknown files. If you wrote the code and used trusted libraries, it's likely not a virus. Just keep in mind that unsigned executables can be risky, so be cautious!
8 track revival: Thanks for clarifying that!
Reply to this answer
PyInstaller is often flagged because itโs known to be used by malware creators. That might explain why your exe is getting marked as suspicious.
basement badminton: Is it definitely a false positive though?
Reply to this answer
Just remember, if the exe isnโt signed, it will likely cause red flags with antivirus programs.
Reply to this answer
Add your answer
Answers are reviewed before publication.
chard stems: Yes, I wrote the code, and I'm confident it's clean.
!do not stack: But what about dependencies? Could they be problematic?