Page 1 of 1

Python-TK File/Folder Selection Crashes in Jessie

PostPosted: October 5th, 2015, 6:06 am
by Gerowen
So I'm running Debian 8 Jessie, and I've got a handful of Python programs/scripts I wrote years ago and have used on Ubuntu and older versions of Debian without issue. Just installed Debian 8 a few weeks ago since my installs of Ubuntu were about to get replaced (15.10 is coming out) anyway, so I figured why not give Debian a shot. Very pleased for the most part, but whenever I try running my scripts that call on python-tk to create a file or folder selection dialog, Python crashes. My scripts use the "easygui" frontend to tkinter, but I tried doing it with just straight tkinter as well and I get the same thing.

To re-create the issue, just create a variable that is equal to the filename of a file or folder you select using a tk window, and then try printing the value of that variable. In IDLE it prints "Restarting" and clears all stored variables (I guess that means it restarted the interpreter), and if you run an affected script in the terminal you get. I've also tried using both Python 2 and Python 3, and the issue happens both times. One of the affected pieces of software is one I've got on SourceForge, just download it and try to run the checkmd5.pyw file (it's plain text if you're paranoid so just open it up and look at it).
https://sourceforge.net/projects/checkm ... =directory

Code: Select all
alloc: invalid block: 0x1ba4e90: 90 1
Aborted


Edit: I've since re-done the scripts in question in Bash just so I have something to fill the need, but I've got one or two of these on SourceForge (just wanted to share them with the community) and people do download them, so I figure if I'm gonna share it with people and tell them it does something, it would be irresponsible of me to not try and figure out what is different about this particular machine that makes it fail.

Re: Python-TK File/Folder Selection Crashes in Jessie

PostPosted: January 25th, 2016, 5:33 pm
by BowCatShot
Just learning python so I gave your app a try. I've got 2.7, 3, and 3.2 installed. The program won't even run on any of them. Doesn't think I have tkinter but I do.

My opinion of python is sinking fast. I never saw such a version mess. Python seems to have replaced dll hell or shared library hell with version hell.

Anyhow this is the error that I get:
Traceback (most recent call last):
File "./checkmd5.pyw", line 9, in <module>
from easygui import *
File "/home/nick/development/Python/CheckMD5/easygui.py", line 87, in <module>
from Tkinter import *
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 42, in <module>
raise ImportError, str(msg) + ', please install the python-tk package'
ImportError: No module named _tkinter, please install the python-tk package

I don't even want to screw around with trying to get it to work.

Re: Python-TK File/Folder Selection Crashes in Jessie

PostPosted: January 25th, 2016, 7:56 pm
by Gerowen
There's separate packages for python-tk in Jessie. python-tk is for Python 2, and python3-tk is for Python 3.