I need to compile my python code to .exe for user distribution. I was trying pyinstaller
- works fine, but Win Defender was blocking generated .exe as virus. I tried several things to avoid it but unsuccessfully.
So now I try to use py2exe utility. I managed it run like this (this should be onefile):
from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
options = {'py2exe': {'bundle_files': 1, 'compressed': True}},
console = ["myApp.py"],
zipfile = None,
)
Compiles ok, I can even run it from dist folder, but as soon as I move .exe to different place it gives me error:
AttributeError: module 'http.client' has no attribute 'HTTPSConnection'. Did you mean: 'HTTPConnection'?
Http is module used in myApp.
This is the content of dist folder: