3

I converted my .py file into an executable program and after trying to run it I got a virus alert from Avast that says that the program is infected with Win32:Malware-gen. The program works well when I disable Avast but that will not work in the long run. Also when I try to email the program through Gmail it blocks the attachment with another virus warning. The program is a simple python database made with tkinter.

Here is the code I used to convert it:

pyinstaller --onefile --windowed

Is there another code that I can use to convert it that would work better? Why do I get the alert?

Thank you

Toms
  • 31
  • 1
  • 1
  • 2
  • It's possible your pyinstaller is infected. I would reinstall it with `pip` from [pypi](https://pypi.org/project/PyInstaller/) and create the .exe again. Also highly recommend that you run a virus scan of your whole computer. It's also possible that the malware warning is completely bogus -- what they call a "false-positive" -- and not really a virus at all. Not sure what to do about that...perhaps you'll need to switch to another .py to .exe convertor—there are several of them. – martineau Jan 12 '19 at 04:08

2 Answers2

3

This is a known issues and could be various reasons which makes your Virus Program think this is a virus.Check this out: https://github.com/pyinstaller/pyinstaller/issues/603

For now, your only other option would be to try out other converters like py2exe. Each have their own pros and cons, you can refer: https://docs.python-guide.org/shipping/freezing/ for a beautiful comparison of them all.

1

Use the jar method

Basically, instead of converting your .py file(s) into an exe file, you instead convert it into a jar file.

Follow this answer:

https://stackoverflow.com/a/1255113/7123519

or

https://wiki.python.org/jython/JythonFaq/DistributingJythonScripts


Sebastian Nielsen
  • 3,835
  • 5
  • 27
  • 43
  • Notice that jython is not compatible with python3, so chances are that this approach will not work for newly developed programs. – mapto May 14 '21 at 07:43