5

While trying to use py2exe to create an executable for my GUI program, I got the following error:

Traceback (most recent call last):
  File "dopy.py", line 139, in <module>
  File "Tix.pyc", line 225, in __init__
_tkinter.TclError: can't find package Tix

My program imports Tix, but py2exe does not package it.

I could not find any solution online that worked, but the closest was http://www.py2exe.org/index.cgi/TixSetup.

Unfortunately, changing the data_files to my Tix path (My Tix8.4.3 instead of the old Tix8.1) does not work either.

My program executable is unable to start without Tix, and py2exe does not seem to want to include it.

Looking in the 'dist' folder that py2exe made, I noticed that there is a tcl folder, and inside it is included a 'tcl8.5' folder and a 'tk8.5' folder, but no Tix folder. These folders were identical ones under my 'Python/tcl/' folder.

Simply copying the 'tix8.4.3' folder into the 'dist/tcl/' folder will include the Tix DLLs and package files, and now my program works!

Paul Vasiu
  • 69
  • 7
  • 1
    you could try `import Tix` in the setup.py. But, if "Simply copying the 'tix8.4.3' folder into the 'dist/tcl/' folder" worked, then the line with data_files is trying to do exactly this. So, make sure that paths are really correct. It should in principle work. – otterb Aug 27 '14 at 17:30
  • have you 'installed' Tix, or did you just copy it? – RvdK Nov 25 '14 at 16:58
  • I believe I just had to copy the folder. I wanted the program and its files to be self contained. – Paul Vasiu Nov 25 '14 at 23:03

1 Answers1

1

Use py2exe option packages to help py2exe find the package 'Tix'.

Werner
  • 2,086
  • 1
  • 15
  • 14