Tkinter on Mac OS crashes python
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. I can provide crash logs if desired. Any help is appreciated. import tkinter from tkinter.constants import * tk = tkinter.Tk() frame = tkinter.Frame(tk, relief=RIDGE, borderwidth=2) frame.pack(fill=BOTH,expand=1) label = tkinter.Label(frame, text="Hello, World") label.pack(fill=X, expand=1) button = tkinter.Button(frame,text="Exit",command=tk.destroy) button.pack(side=BOTTOM) tk.mainloop() Chip -- https://mail.python.org/mailman/listinfo/python-list
Re: Tkinter on Mac OS crashes python
Terry, Thanks for the input and FYI I am running 10.14.4 Mojave. When I looked at the version of tkinter as suggested by Chris Angelico earlier in this thread it returned '/Users/chip/anaconda3/lib/python3.6/tkinter/__init__.py’. This is obviously not he build Apple provided and I believe Apple’s version of python is version 2.7 and I need to use 3.6 for my current efforts. I will reach out to Anaconda to see if they have any thoughts and will look into the Python.org <http://python.org/> installers. Will look at the Python.org <http://python.org/> installers also. Thanks! Chip Towner c...@gct3engineering.com > On May 14, 2019, at 22:59, Terry Reedy wrote: > > On 5/14/2019 1:22 PM, Chip Towner 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. > > Before releasing the PSF 3.6.8 Mac installer on python.org, Ned Deily > experimented with different recent tcl/builds to pick the one that worked > best. (I believe there are different builds with the designation 8.6.8). > What he choose was not the most recent version available. One issue is that > different builds worked best with the then new macOS version (Mohave?) and > earlier versions. (You did not say which you are running.) I presume > tkinter.Tk() ran on all versions he tested, as that is needed for any tkinter > program. > > If Anaconda installs any build of tcl/tk other than the one istalled by the > 'official' installer, then they should deal with this issus. > > You could try installing from the python.org installer and test again. > > -- > Terry Jan Reedy > > -- > https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list