Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

py2exe can't find package Tix

Tags:

python

py2exe

tix

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!

like image 636
Paul Vasiu Avatar asked Nov 13 '22 01:11

Paul Vasiu


1 Answers

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

like image 190
Werner Avatar answered Jan 16 '23 04:01

Werner