18

I'm trying to use minty's solution provided on this link to generate a single exe file for my Tkinter based program:

py2exe - generate single executable file

Here's what I wrote in the setup.py:

from distutils.core import setup
import py2exe, sys, os

sys.argv.append('py2exe')

setup(windows=[{'script': 'filename.py'}], \
            options={"py2exe": {"includes": ["decimal", "Tkinter", \
            "tkFileDialog", "csv", "xml.dom.minidom", "os"], \
            'bundle_files': 1, 'compressed': False}}, \
            zipfile = None)

It creates a 'tcl' folder for Tkinter stuff even though I have specified bundle_files = 1. Plus it also generates some other exe w9xpopen.exe. My actual exe, however, does not run, and it doesn't give any errors either. It doesn't even work if I remove all those includes.

Any thoughts on what I could be missing here? I'm working on a 64-bit Windows 7 machine.

3
  • Does it work without bundle_files? Commented Feb 20, 2013 at 8:12
  • It does that way, but I intend to bundle everything into a single exe file. bundle_files = 3 works fine. Commented Feb 20, 2013 at 9:06
  • some posts indicate that bundle_files 1 & 2 don't work with 64bit system... Commented Dec 9, 2016 at 5:31

1 Answer 1

12

Thanks to this link, you have to edit site-packages/py2exe/build_exe.py and add "tcl85.dll" and "tk85.dll" to the dlls_in_exedir list. This will get it to run, although you'll still have the tcl folders, and those two dlls will be there along-side the exe. But it's way better than bundle_files=3.

        self.dlls_in_exedir = [python_dll,
                               "w9xpopen%s.exe" % (is_debug_build and "_d" or ""),
                               "msvcr71%s.dll" % (is_debug_build and "d" or ""),
                               "tcl85.dll",
                               "tk85.dll"]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.