Reputation: 2500
While porting Python 2.7 script to Python 3.5, this code crashes in Windows Anaconda 2.4.1 (64-bit):
import tkinter as Tk
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
root = Tk.Tk()
fig = plt.figure()
canvas = FigureCanvasTkAgg(fig, master=root)
canvas.get_tk_widget().place(relx=0.02, rely=0.14, relheight=0.83, relwidth=0.96)
Tk.mainloop()
The root cause is get_tk_widget().place()
method. Windows Event View provides this info:
Faulting application name: python.exe, version: 3.5.1150.1013, time stamp: 0x5665f370
Faulting module name: tcl86t.dll, version: 8.6.2.4, time stamp: 0x55dbf93d
Exception code: 0xc0000005
Fault offset: 0x00000000000165a9
Faulting process id: 0x26a4
Faulting application start time: 0x01d1364cdb6d7ba9
Faulting application path: C:\Anaconda3\python.exe
Faulting module path: C:\Anaconda3\DLLs\tcl86t.dll
Is it a well-known bug? How to fix this?
Upvotes: 4
Views: 1298
Reputation: 2500
I figure out just by reinstalling matplotlib via pip:
pip uninstall matplotlib
pip install matplotlib
Upvotes: 4