Search code examples
pythonexepackagingpython-3.3cx-freeze

Generate single exe-file from compiled application


I compiled my python-application using cx_freeze, after compiling I got the file "main.exe" - the main application and 28 additional files including DLL library.

Now it looks like this

enter image description here

Now I need to pack all the files into single exe-file, because if now I run main.exe from another directory I get an error message, because the DLL library is missing.

What app can help me to assembly all files into one exe-file?

Thanks in advance!


Solution

  • Try using Pyinstaller instead of cx_freeze, it gives you the option of onefile instead of the package..

    with pyinstaller you can just do.

    pyinstaller --onefile myfile.py
    

    which will create a single executable with all the modules in it.. i use it several times.