4

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?

1 Answer 1

4

I figure out just by reinstalling matplotlib via pip:

pip uninstall matplotlib
pip install matplotlib
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.