osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tkinter on Mac OS crashes python


On Wed, May 15, 2019 at 11:13 AM Chip Towner <chip at gct3engineering.com> wrote:
>
> I am trying to use tkinter and when I attempt to do so Python crashes.  I am accessing Python (v 3.6.8) in Spyder (v3.6) from Anaconda.  The version of TkVersion tells me the version is 8.6 and the Anaconda environment browser tells me it is 8.6.8.
>
> An example piece of code I am trying to run (pulled from the __init__.py file in the tkinter code installed by Anaconda) is provided below.  The code crashes when tk = tkinter.Tk() is called.  I have traced the crash into this method to a call to _tkinter.create().  The debugger can?t step any further.
>

Possibly significant: This is not the Python provided by Mac OS; you
have multiple installations of Python.

Can you try this, please?

>>> import sys, tkinter
>>> sys.executable, tkinter.__file__

Might be that you're getting tkinter from a different installation,
which could break all manner of things. Might be not, too, but worth
checking.

ChrisA