Program made with PyInstaller now seen as a Trojan Horse by AVG

I was always getting some false positives with Pyinstaller from VirusTotal. This is how I fixed it: Pyinstaller comes with pre-compiled bootloader binaries for different OSs. I suggest compile them by yourself on your machine. Make sure everything is consistent on your machine. For Windows 64bit, install Python 64bit. Download PyInstaller 64bit for Windows. Make … Read more

Determining application path in a Python EXE generated by pyInstaller

I found a solution. You need to check if the application is running as a script or as a frozen exe: import os import sys config_name=”myapp.cfg” # determine if application is a script file or frozen exe if getattr(sys, ‘frozen’, False): application_path = os.path.dirname(sys.executable) elif __file__: application_path = os.path.dirname(__file__) config_path = os.path.join(application_path, config_name)

Bundling data files with PyInstaller (–onefile)

Newer versions of PyInstaller do not set the env variable anymore, so Shish’s excellent answer will not work. Now the path gets set as sys._MEIPASS: def resource_path(relative_path): “”” Get absolute path to resource, works for dev and for PyInstaller “”” try: # PyInstaller creates a temp folder and stores path in _MEIPASS base_path = sys._MEIPASS … Read more